Asymptotic Complexity
Big-O Notation
Big-Omega Notation
Big-Theta Notation
Summary
If f (n) = Θ(g (n)) we say that f (n) and g (n) grow at the
same rate asymptotically
If f (n) = O(g (n)) but f (n) 6= Ω(g (n)), then we say that f (n)
is asymptotically slower growing than g (n).
If f (n) = Ω(g (n)) but f (n) 6= O(g (n)), then we say that f (n)
is asymptotically faster growing than g (n).
T (N) = N ∈ O(N)
Show that this recurrence captures the running time complexity of
determining the maximum element, searching in an un-sorted array
N(N + 1)
T (N) = ∈ O(N 2 )
2
Show that this recurrence captures the running time complexity of
bubble/insertion/selection sort
T (N) = lg N + 1 ∈ O(lg N)
Show that this recurrence captures the running time complexity of
binary search
T (N) = 2N ∈ O(N)
No problem examined so far in this course whose behaviour is
modelled by this recurrence relation
T (N) = N lg N ∈ O(N lg N)
Show that this recurrence captures the running time complexity of
quicksort
T (N) = 2N − 1 ∈ O(2N )
Show that this recurrence captures the running time complexity of
the towers of Hanoi problem