[用JS來寫演算法和了解資料結構] Day12 Algorithm - Sorting 排序

[用JS來寫演算法和了解資料結構] Day12 Algorithm - Sorting 排序

Sorting 排序

  • 排序 Sorting:
    Comparison Sort
  1. 氣泡排序 Bubble Sort - Time O(n) or O(n^2) / Space - O(1)

  2. 選擇排序 Selection Sort - Time O(n^2) / Space - O(1)

  3. 插入排序 Insertion Sort - Time O(n) or O(n^2) / Space - O(1)

  4. 合併排序 Merge Sort - Time O(n log n) / Space - O(n)

  5. 快速排序 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
Read more
Your browser is out-of-date!

Update your browser to view this website correctly.&npsb;Update my browser now

×