1 / 10

Review for Midterm Exam

Review for Midterm Exam. Andreas Klappenecker. 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

reidj
Download Presentation

Review for Midterm Exam

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  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 n0 and a real constant C such that |f(n)| <= C|g(n)| for all n>= n0 } (g) = { f:N->R | there exists an integer n0 and a real constant c such that |f(n)| => c|g(n)| for all n>= n0 }

  4. Asymptotic Notation • ½(n2+n+6) = O(n2) • 6n2 = O(n2) • 10765432n2+2n+7= (n2) • ½(n2+n+6) = (n2) • (g) = (g)  O(g) • ½(n2+n+6) = (n2)

  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

More Related