Skip to content

Instantly share code, notes, and snippets.

@panmari
Created May 29, 2012 21:56
Show Gist options
  • Save panmari/2831040 to your computer and use it in GitHub Desktop.
Save panmari/2831040 to your computer and use it in GitHub Desktop.
Some examples for determining the average performance of algorithms
1.
from i:= 1 until i > n loop
from j:= 1 until j > i loop
j:= j+1
end
i := i*2
end
2.
from i:= 1 until i > n loop
from j:= i until j > n loop
j:= j+1
end
i := i*2
end
3.
from i:= 1 until i > n loop
from j:= 1 until j > i loop
j:= j*2
end
i := i+1
end
4.
from i:= 1 until i > n loop
from j:= i until j > n loop
j:= j*2
end
i := i+1
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment