What is Sorting?

Sorting is the process of arranging items in a specific order, typically ascending or descending. Sorting algorithms are crucial in computer science for organizing data, enabling efficient data retrieval, and optimizing other operations. They vary in complexity, speed, and suitability for different data types and sizes.

In this visualizer, you can explore various sorting algorithms, each with its own approach to sorting data. From basic ones like Bubble Sort and Selection Sort to more advanced algorithms like Merge Sort, Quick Sort, and Tim Sort, you'll see how each one works and what makes them unique.


Sorting Algorithm Visualizer

Explore and understand various sorting algorithms through interactive visualizations. Select an algorithm to see how it sorts a list of numbers step by step.

Bubble Sort

A simple comparison-based algorithm where elements are repeatedly swapped to sort the array.

Selection Sort

An in-place comparison sorting algorithm that selects the smallest element and moves it to the beginning.

Insertion Sort

A simple algorithm that builds the final sorted array one item at a time.

Merge Sort

A divide-and-conquer algorithm that divides the array, sorts each half, and merges them back together.

Quick Sort

An efficient, divide-and-conquer algorithm that sorts by partitioning an array into smaller sub-arrays.

Heap Sort

A comparison-based algorithm that uses a binary heap data structure to sort elements.

Shell Sort

An optimization over Insertion Sort that allows elements to move farther apart, reducing the total number of swaps.

Counting Sort

A non-comparison sorting algorithm that sorts integers by counting occurrences of each value.

Radix Sort

A non-comparison sorting algorithm that sorts numbers by their individual digits.

Tim Sort

An optimized hybrid sorting algorithm derived from Merge Sort and Insertion Sort, used in Python's sort.

Bucket Sort

A sorting algorithm that distributes elements into buckets, which are then sorted individually.