previous | start | next

Useful Identities for Program Run Time Analysis

O(...) means "order of growth ...

Arithmetic Sum

(1)   1 + 2 + 3 + 4 + ... + N = 0.5N2 + 0.5N 
                              ~ 0.5N2
                              = O(N2)
   

Geometric Sum

For N a power of 2: N = 2k

(2) 1 + 2 + 4 + 8 + ... + N = 2N - 1
                            ~ 2N
                            = O(N)
   


previous | start | next