cs101-notes
  • CS 101 Notes
  • Big O Notation
  • Big O Cheat Sheet
  • Sorting
    • Summary
    • Bubble Sort
    • Selection Sort
    • Insertion Sort
    • Merge Sort
    • Quick Sort
  • Abstract Data Types
    • Linked List
    • Stack
    • Queue
    • Hash Maps
    • Minimum Ordered Heap
Powered by GitBook
On this page

Was this helpful?

  1. Sorting

Summary

PreviousBig O NotationNextBubble Sort

Last updated 5 years ago

Was this helpful?

Algorithm

Best Case

Average Case

Worst Case

Stable?

O(N)

O(N^2)

O(N^2)

Yes

O(N^2)

O(N^2)

O(N^2)

No

O(N)

O(N^2)

O(N^2)

Yes

O(N lg N)

O(N lg N)

O(N lg N)

Yes

O(N lg N)

O(N lg N)

O(N^2)

No

Bubble Sort
Selection Sort
Insertion Sort
Merge Sort
Quick Sort