↓Skip to main content

Quicksort

LeetCode 75: Sort Colors
·2 mins
LeetCode Medium Array Two-Pointers Sorting Quicksort
LeetCode 75 note: the Dutch flag, with 0s left of low and 2s right of high; after swapping a 2 to high, do not advance, since the swapped-in value is unchecked
LeetCode 56: Merge Intervals
·2 mins
LeetCode Medium Array Sorting Quicksort
LeetCode 56 note: sort by start; if a new interval starts at or before the last merged end, merge (taking the max end), otherwise open a new one