30
50
Select an algorithm to begin
Select an Algorithm
Time: -
Space: -
Stable: -
About Sorting Algorithms
Bubble Sort
Repeatedly steps through the list, compares adjacent elements and swaps them if they are in the wrong order.
Time: O(n²)
Space: O(1)
Stable: Yes
Insertion Sort
Builds the final sorted array one item at a time by repeatedly inserting the next element into the sorted portion.
Time: O(n²)
Space: O(1)
Stable: Yes
Selection Sort
Finds the minimum element from the unsorted portion and places it at the beginning.
Time: O(n²)
Space: O(1)
No
Quick Sort
Uses divide and conquer approach by selecting a pivot and partitioning the array around it.
Time: O(n log n)
Space: O(log n)
No
Merge Sort
Divides the array into two halves, sorts them separately, then merges them back together.
Time: O(n log n)
Space: O(n)
Stable: Yes
Algorithm Mini-Demonstrations
Bubble Sort
Insertion Sort
Selection Sort
Quick Sort
Merge Sort
Complexity Legend
O(n log n) - Excellent
O(n) - Good
O(n²) - Fair
O(n³) - Poor