[用JS來寫演算法和了解資料結構] Day12 Algorithm - Sorting 排序
Sorting 排序
- 排序 Sorting:
Comparison Sort
氣泡排序 Bubble Sort - Time O(n) or O(n^2) / Space - O(1)
選擇排序 Selection Sort - Time O(n^2) / Space - O(1)
插入排序 Insertion Sort - Time O(n) or O(n^2) / Space - O(1)
合併排序 Merge Sort - Time O(n log n) / Space - O(n)
快速排序 Quick Sort - Time O(n log n) / Space - O(log n)
合併排序 Merge Sort 和 快速排序 Quick Sort 用 Divide and Conquer Recursion 方式
Heap Sort
Non-Comparison Sort
- Counting Sort
- Radix Sort