1 Review for Midterm Exam Andreas Klappenecker
2 Topics Covered Finding Primes in the Digits of Euler's Number Asymptotic Notations: Big Oh, Big Omega, Big Theta Time complexity of Insertion Sort Lower bounds for sorting Divide-and-Conquer Algorithms Mergesort Strassen's method for Matrix Multiplication Greedy Algorithms, Huffman codes Greedy Algorithms for Matroids Matroid Embeddings Dynamic Programming, Matrix Chain Multiplication Dynamic Programming, Longest Common Subsequence Amortized Analysis Disjoint Sets
3 Asymptotic Notations O(g) = { f:N->R | there exists an integer n 0 and a real constant C such that |f(n)| <= C|g(n)| for all n>= n 0 } (g) = { f:N->R | there exists an integer n 0 and a real constant c such that |f(n)| => c|g(n)| for all n>= n 0 }
4 Asymptotic Notation ½(n 2 +n+6) = O(n 2 ) 6n 2 = O(n 2 ) n 2 +2n+7 = (n 2 ) ½(n 2 +n+6) = (n 2 ) (g) = (g) O(g) ½(n 2 +n+6) = (n 2 )
5 Sorting Insertion Sort Best case running time: linear Worst case running time: quadratic Merge Sort O(n log n) Any comparison based sorting (n log n)
6 Divide-and-Conquer Mergesort Quicksort Strassen’s matrix multiplication algorithm Recurrence relations Master theorem (no need to memorize)
7 Greedy Algorithms Coin change Huffman codes Matroids Kruskal’s algorithm Matroid embeddings Prim’s algorithm
8 Dynamic Programming Matrix chain multiplication Longest common subsequences Variations: Edit distance
9 Amortized Analysis Aggregate Analysis Accounting Method Stacks Counter Disjoint Sets
10 Exam Some short questions Some workout problems Lectures Slides Textbook Quizzes Homework