为了一顿饭,50+排序算法的思路分析和python代码实现,列表来自bilibili用户robinbz的评论,https://www.bilibili.com/video/BV1bg4y1q7es, 争取全自己写,如果一些不会的看了别人的代码我会会贴参考的代码地址
Exchange family
0:04 Bubble Sort 0:22 Cocktail Shaker Sort 0:37 Gnome Sort 1:05 Optimized Gnome Sort 1:22 Odd-Even Sort 1:41 Comb Sort 2:09 Quick Sort 2:22 Stable Quick Sort 2:43 Dual-Pivot Quick Sort
Selection family
3:05 Selection Sort 3:16 Double Selection Sort 3:28 Max Heap Sort 3:52 Min Heap Sort 4:17 Ternary Heap Sort 4:37 Weak Heap Sort 4:53 Smooth Sort 6:07 Tournament Sort
Insertion family
6:37 Insertion Sort 6:54 Binary Insertion Sort 7:12 Shell Sort 5:15 Cycle Sort 7:28 Patience Sort
Merge family
7:41 Merge Sort 8:30 In-Place Merge Sort
Non-comparison family
9:00 American Flag Sort, 256 Buckets 9:14 Bead (Gravity) Sort 9:40 Counting Sort 9:46 Pidgeonhole Sort 9:52 Radix LSD Sort, Base 4 10:22 In-Place Radix LSD Sort, Base 16 10:46 Radix MSD Sort, Base 8 11:08 Flash Sort 11:20 Shatter Sort 11:39 Simple Shatter Sort 12:00 Time Sort (Mul 4) [more widely known as Sleep Sort]
Sorting Networks / Concurrent family
12:16 Batcher's Bitonic Sort 13:11 Batcher's Odd-Even Merge Sort
Hybrids
13:34 Hybrid Comb Sort (Comb/Insertion) 13:55 Binary Merge Sort (Merge/Binary Insertion) 14:41 Weave Mergee Sort (Merge/Insertion) 15:34 TimSort 16:18 WikiSort (Block Merge Sort) 16:57 GrailSort (Block Merge Sort) 17:24 std::sort (Introsort) 17:46 Quick Shell Sort (Introsort with Shellsort) 18:06 std::stable_sort (Insert/Bottom-up Merge)
Esoteric / Fun
18:35 Pancake Sort 21:14 Stooge Sort 22:09 Bad Sort 22:30 Silly Sort 24:10 Slow Sort 25:51 Less Bogo Sort 27:10 Cocktail Bogo Sort 28:37 Bogo Sort