Concept
Quicksort picks a pivot, partitions the array into smaller and larger elements around it, and sorts each side. It is O(n log n) on average and sorts in place, but a bad pivot makes it O(n^2).
The tutor works through these with you, in conversation and code. A session ends when you have shown them, not when a video does.
A few lines that show Quicksort doing its job.
import random
def quicksort(a, lo=0, hi=None):
if hi is None: hi = len(a) - 1
if lo >= hi: return
pivot = a[random.randint(lo, hi)]
i, j = lo, hi
while i <= j:
while a[i] < pivot: i += 1
while a[j] > pivot: j -= 1
if i <= j:
a[i], a[j] = a[j], a[i]; i += 1; j -= 1
quicksort(a, lo, j); quicksort(a, i, hi)Always choosing the first or last element as the pivot. On already sorted input every partition is lopsided and the sort degrades to O(n^2) with recursion as deep as the array.
Your roadmap puts these before Quicksort, unless you already know them.
Once a session shows you understand Quicksort, it comes back for review. Each review takes a minute and tells the memory model how well you still know it.