Contents    Page-10    Prev    Next    Page+10    Index   

Log-log Example

Suppose that f(n) = 25 * n2 .

n f(n)
2 100
3 225
4 400
5 625
6 900

The log-log graph makes it obvious that f(n) is O(n2): if the slope of the line is k, the function is O(nk).

The points that are plotted from the function lie on a straight line that is parallel to a known O(n2) line.