Adibe7
Adibe7

Reputation: 3539

What is an example of an algorithm with complexity of O(n^5)?

can anyone provide an example of an algorithm with minimal running time complexity of O(n^5)?

Upvotes: 4

Views: 2743

Answers (6)

Sumudu Fernando
Sumudu Fernando

Reputation: 1763

Convex hull in 10 dimensions has been proven to require O(n^5) (the proof was for general d, showing that the hull can be O(n^floor(d/2)) in the worst case, IIRC)

Upvotes: 1

nvk
nvk

Reputation: 185

Finden and Gordon's algorithm on Obtaining common pruned trees runs in O(n^5)

Upvotes: 3

Brandon Frohbieter
Brandon Frohbieter

Reputation: 18139

O n5 volume algorithm for complex bodies.

http://matmod.elte.hu/~lovasz/vol5.pdf

Upvotes: 8

dana
dana

Reputation: 18155

void N5(int n)
{
    for( int n1 = 0; n1 < n; n1++ )
    {
        for( int n2 = 0; n2 < n; n2++ )
        {
            for( int n3 = 0; n3 < n; n3++ )
            {
                for( int n4 = 0; n4 < n; n4++ )
                {
                    for( int n5 = 0; n5 < n; n5++ )
                    {
                        DoSomething();
                    }
                }
            }
        }
    }
}

Upvotes: 4

Alex Lo
Alex Lo

Reputation: 1299

for 1 to n
 for 1 to n
  for 1 to n
   for 1 to n
    for 1 to n
     Do Something

Upvotes: 4

Related Questions