Algorithm Visualizer

Visualize how sorting algorithms work step by step. Compare Bubble, Selection, Insertion, Quick, and Merge sort.

Comparisons: 0
Swaps: 0
Status: Ready

Time Complexity Comparison

AlgorithmBestAverageWorstSpaceStable
Bubble SortO(n)O(n²)O(n²)O(1)Yes
Selection SortO(n²)O(n²)O(n²)O(1)No
Insertion SortO(n)O(n²)O(n²)O(1)Yes
Quick SortO(n log n)O(n log n)O(n²)O(log n)No
Merge SortO(n log n)O(n log n)O(n log n)O(n)Yes

Sorting Algorithm FAQ

Which sorting algorithm is fastest?

Quick Sort and Merge Sort are generally fastest at O(n log n) average. The optimal choice depends on data characteristics.

What is a stable sort?

A stable sort preserves the relative order of equal elements. Bubble, Insertion, and Merge Sort are stable.

What sort is used in practice?

Most programming languages use Tim Sort (a hybrid of Merge and Insertion Sort). JavaScript's Array.sort() is also Tim Sort based.

Sorting Algorithm Visualizer Guide

The Sorting Algorithm Visualizer animates how Bubble, Selection, Insertion, Quick, and Merge Sort work. Adjust array size and speed to compare comparison counts, swap counts, and time complexities.

This calculator is provided for informational purposes only.

Results are estimates and may differ from actual amounts.

© 2025 calculkorea. All rights reserved.

Link copied!