Back to Learn
Sorting Algorithms
Choose an algorithm to visualize and understand its mechanics.
Quick Sort
A highly efficient, divide-and-conquer algorithm. It picks an element as a 'pivot' and partitions the array.
O(n log n)Merge Sort
Divides the array into two halves, recursively sorts them, and then merges the sorted halves.
O(n log n)Heap Sort
Comparison-based sorting technique based on Binary Heap data structure.
O(n log n)Bubble Sort
Repeatedly swaps adjacent elements if they are in the wrong order. Simple but inefficient.
O(n²)Insertion Sort
Builds the final sorted array one item at a time. Efficient for small data sets.
O(n²)Selection Sort
Repeatedly finds the minimum element from the unsorted part and puts it at the beginning.
O(n²)