Sort - cocoder39/coco39_LC GitHub Wiki
- 86. Partition List (partition)
- 75. Sort Colors (three-way partition, repeated elements)
- 215. Kth Largest Element in an Array (two-way partition, binary search, heap) template of quick select
- 347. Top K Frequent Elements
- 973. K Closest Points to Origin
- 21. Merge Two Sorted Lists (merge)
- 148. Sort List
- Inversion count (can also be solved with BIT and BST)
heap sort
- 23. Merge k Sorted Lists (merge 2 lists/ heap)
- 378. Kth Smallest Element in a Sorted Matrix (comparator)
- 373. Find K Pairs with Smallest Sums
- 347. Top K Frequent Elements
- 295. Find Median from Data Stream
- 1882. Process Tasks Using Servers
- 1801. Number of Orders in the Backlog
- 1405. Longest Happy String
- 215. Kth Largest Element in an Array
bucket sort (bucket for int and trie for string)
- 49. Group Anagrams
- 274. H-Index
- 164. Maximum Gap
- 296. Best Meeting Point
- 347. Top K Frequent Elements (heap / bucket)
- 451. Sort Characters By Frequency
insertion sort
wiggle sort
- 280. Wiggle Sort
- 324. Wiggle Sort II (find kth, three-way partition)
customize comparator
interval
- 252. Meeting Rooms (greedy)
- 253. Meeting Rooms II (greedy, heap)
- 56. Merge Intervals
- 57. Insert Interval
intersection
Misc