how can I can find the asymptotic runtime behavior of any algorithm?
+1
A:
You need to derive a formula for the number of steps an algorithm takes in its loops/recursions in terms of the size of the input n and then take the summation. http://en.wikipedia.org/wiki/Analysis_of_algorithms has an example.
Kui Tang
2010-03-10 01:33:28