CSE 4833/6833  Introduction to Analysis of Algorithms (Spring 2018)

Asymptotic analysis

            Case 1: if a>bda > b^d, then T(n)=Θ(nlogba)T(n) = \Theta(n^{log_{b}a})
            Case 2: if a=bda = b^d, then T(n)=Θ(ndlogn)T(n) = \Theta(n^{d} \log n)
            Case 3: if a<bda < b^d, then T(n)=Θ(nd)T(n) = \Theta(n^d) a < b^{d},

Numerical algorithms

Search for an item in an array

Array sorting algorithms

Algorithm Time Complexity Space Complexity

Best Average Worst Worst
Insertion Sort Ω(n) Θ(n^2) O(n^2) O(1) Stable
Selection Sort Ω(n^2) Θ(n^2) O(n^2) O(1)
Quicksort Ω(n log(n)) Θ(n log(n)) O(n^2) O(log(n))
Mergesort Ω(n log(n)) Θ(n log(n)) O(n log(n)) O(n) Stable
Heapsort Ω(n log(n)) Θ(n log(n)) O(n log(n)) O(1)
Bucket Sort Ω(n+k) Θ(n+k) O(n^2) O(n)
Radix Sort Ω(nk) Θ(nk) O(nk) O(n+k) Stable
Counting Sort Ω(n+k) Θ(n+k) O(n+k) O(k) Stable

Selection problem
Convex hull problem