Quicksort

Table of Contents:

Talking About Stuff 0:00 - 1:05
Introducing Quicksort 1:05 - 2:04
The Split Subroutine 2:04 - 2:43
The Partition Subroutine 2:43 - 3:24
Partitioning: Choosing A Bad Pivot 3:24 - 10:34
Partitioning: Choosing A Good Pivot 10:34 - 15:11
Analysis: Choosing Bad Pivots 15:11 - 19:06
Analysis: Choosing Good Pivots 19:06 - 22:07
Analysis: Good Pivots - Work Done At Leaf Level 22:07 - 23:37
Flashback To Merge Sort 23:37 - 24:01
Why Quicksort Is O(n*log(n)) 24:01 - 25:02
Wrap Up 25:02 - 26:12

Some Errors:

3:25 - 15:11 -> I messed up how I advanced 'i' in both examples. I should have started 'i' at left - 1 everytime...my bad. What should happen is that we should start 'i' at 'left - 1' and anytime we swap into 'i' we always advance 'i' FIRST before the swap. These errors don't change the fundamental job of 'i', which is to keep the tail of the section of items less than the pivot. Make sure you take that away from this.
4:02 -> Forgot to edit that text out haha
24:23 -> This is only the exact bound on the best case. Not the average case as well.

Code: https://github.com/bephrem1/backtobackswe/blob/master/Sorting%2C%20Searching%2C%20%26%20Heaps/Quicksort/Quicksort.java
GeeksForGeeks: https://www.geeksforgeeks.org/quick-sort/

Discussion

0 comments