vu

Notes for Vanderbilt University

View the Project on GitHub

Lecture 03-24-17

Take Home Exam 4 Review:

  1. Expand
  2. Use the same reasoning for the big 5 selection algorithm
    • Boxes are of size n/3 so recurrence is T(2n/3)
    • Runtime with big 3 becomes O(nlogn)
  3. Sorting comparisons
    • Selection sort will repeat
    • Insertion sort will not
  4. Mergesort cannot repeat comparisons
    • At any point in time when comparisons are done in merges, you will output one of those to the final list
    • Show that mergesort does not do a good job of always dividing the number of comparisons in two
      • Reach [1, …, k] merge [k + 1, …, n]
      • Reach comparison last element k, with any position with [k + 1, …, n]
      • n orders of interweaving the last element with the other set
    • This leads to another algorithm that always come close to dividing possible outcomes in 2
      • Binary insertion sort
        • Why is this not the easiest nlogn sorting algorithm?
          • Have to shift elements
          • Sorting algorithms not always bounded on comparisons

Floyd’s Algorithm

NP completeness

Classes of problems