Sorting

Sorting Algorithms Visualizer

Explore different sorting algorithms and understand how they work, step-by-step. Click on any algorithm below to start the visualization!

Bubble sort

Bubble Sort

Compares adjacent elements and swaps them if they're in the wrong order.

Selection sort

Selection Sort

Finds the smallest element in the array and places it at the front.

Insertion sort

Insertion Sort

Builds the sorted array by inserting elements in their correct position.

Merge sort

Merge Sort

Divides the array, sorts them, and merges them back together.

Quick sort

Quick Sort

Uses a pivot to partition the array and sorts each partition.

Heap sort

Heap Sort

Transforms the array into a heap structure and sorts it.

Radix sort

Radix Sort

Sorts numbers by processing individual digits from least to most significant.

Shell sort

Shell Sort

Sorts elements by comparing elements at a gap and reducing the gap over time.

Summary

Summary

Summary of all the sorting algorithms their worst, average and best case complexities in one table.