Sorting Algorithms
Visualize how different sorting algorithms organize data
Bubble Sort
Bubble Sort is a simple sorting algorithm that repeatedly steps through the list, compares adjacent elements and swaps them if they are in the wrong order. It's easy to understand but inefficient for large datasets.
Merge Sort
Merge Sort is a divide-and-conquer algorithm that divides the array into halves, sorts them recursively, and then merges the sorted halves. It has consistent O(n log n) performance and is stable.
Quick Sort
Quick Sort is a divide-and-conquer algorithm that picks a pivot element and partitions the array around it. It's one of the fastest sorting algorithms in practice, though worst-case performance is O(n²).
Insertion Sort
Insertion Sort builds the sorted array one element at a time by inserting each element into its correct position. It's efficient for small datasets and nearly sorted arrays.