Explore different sorting algorithms and understand how they work, step-by-step. Click on any algorithm below to start the visualization!
Compares adjacent elements and swaps them if they're in the wrong order.
Finds the smallest element in the array and places it at the front.
Builds the sorted array by inserting elements in their correct position.
Divides the array, sorts them, and merges them back together.
Uses a pivot to partition the array and sorts each partition.
Transforms the array into a heap structure and sorts it.
Sorts numbers by processing individual digits from least to most significant.
Sorts elements by comparing elements at a gap and reducing the gap over time.
Summary of all the sorting algorithms their worst, average and best case complexities in one table.