Sorting Algorithms
Step 0 / 0
- Compared
- Moved
- Pivot / key
- In place
Initial Array:
Sorted Array:
- Comparisons
- –
- Writes
- –
- Steps shown
- –
| Best |
Average |
Worst |
Extra memory |
Stable |
| – |
– |
– |
– |
– |
Comparisons are counted by running the algorithm on values that count each comparison; writes are the positions that changed between steps.
Sorting race
Two algorithms sort the same numbers. The clock counts work (comparisons + writes), so whoever does the least work wins.
Comparisons + writes: 0
Comparisons + writes: 0
Each algorithm's steps are spread over its total work, so the bars show roughly how far it has come; the finishing order is exact.
How the work grows (Big-O)
Each algorithm sorted lists of 5 to 100 numbers.
Show the numbers