time complexity

Calculate the time 僴complexity of the following procedure .funtion1(){ for i=1 to n do i=i+1 for j = 1 to n do for k = n*n downto 1 dosum=sum+1}
[208 byte] By [gomaa] at [2007-10-1 21:51:39]
# 1
This isn't even Java.Do your own homework.
tschodta at 2007-7-13 7:54:54 > top of Java-index,Other Topics,Algorithms...
# 2

> Calculate the time 僴complexity of the following

> procedure .

> funtion1()

> {

> for i=1 to n do

>i=i+1

> for j = 1 to n do

>for k = n*n downto 1 do

>sum=sum+1

> }

What do you think the complexity is?

Hint: Google for [url=http://www.google.com/search?q=%22big+o+notation%22&btnG=Search+the+Web]"big o notation"[/url]

prometheuzza at 2007-7-13 7:54:54 > top of Java-index,Other Topics,Algorithms...
# 3
i think it is O(n^4) what u think?
gomaa at 2007-7-13 7:54:54 > top of Java-index,Other Topics,Algorithms...
# 4
> i think it is O(n^4) what u think?O(N**(log N))~Cheers
Adeodatusa at 2007-7-13 7:54:54 > top of Java-index,Other Topics,Algorithms...
# 5
Time and complexity... (I am pasting in the same answer to this thread, as it is equally valid)The total time T(n) spent on solving your n homework assignments could be reduced if you actually tried to learn something about the subject!
Ragnvald_id2a at 2007-7-13 7:54:54 > top of Java-index,Other Topics,Algorithms...