yigityalim
projectshandbookslabshireshare
xgithub
Back to Labs
May 10, 2026·data

Sorting Algorithm Visualizer

Bubble, insertion, selection, quick, merge — watch five classic sorts run live as a bar chart. Step / play / 1×–16× speed. Comparison, swap and sorted states color-coded.

algorithms · sorting · visualization

PreviousSHA-2 Hash Lab
siteprojectshandbookslabschangelog
aboutusesnowhireshare
elsewherexgithublinkedinemail
metarssllms.txtsitemap
© 2026 Yiğit Yalım. All rights reserved.
/

Knowing sorting algorithms is one thing; seeing them is another. Quicksort's partitioning, merge sort's divide-and-conquer, bubble sort's slowness — visible.

SortingVisualizer · O(n log n)
cmp: 0swap: 0
0/151
boyut24
unsortedcomparingswappingsorted
worst: O(n²)total steps: 151

Comparison

AlgorithmBestAvgWorstStableIn-place
BubbleO(n)O(n²)O(n²)✓✓
InsertionO(n)O(n²)O(n²)✓✓
SelectionO(n²)O(n²)O(n²)✗✓
QuickO(n log n)O(n log n)O(n²)✗✓
MergeO(n log n)O(n log n)O(n log n)✓✗

JS's Array.prototype.sort() uses TimSort (insertion + merge hybrid) in modern engines. Best case O(n) on already-sorted data, worst case O(n log n).

Color legend

  • Gray — not yet touched
  • Blue — being compared in this step
  • Amber — currently swapping
  • Green — settled into final position