O-notation
- From: Ronny Mandal <ronnyma@xxxxxxxxxxx>
- Date: Mon, 21 Nov 2005 12:41:14 +0100
Please consider the following code:
for (i = 1; i<= n; i++)
for (j = 1; j<=n; j = 2 *j)
for (k = 1; k < n; k = 2 * k)
x = x + 1;
Since this contains two loops tht increments their index by 2*1, 2*2,
2*3 ...2*n, and the outer is linear I would say that the running-time
is n(log n)^2.
Correct?
--
Regards,
Ronny Mandal
.
- Follow-Ups:
- Re: O-notation
- From: Pat Farrell
- Re: O-notation
- Prev by Date: category theory question
- Next by Date: Re: "Reverse Doubling List", is there another name?
- Previous by thread: category theory question
- Next by thread: Re: O-notation
- Index(es):