Sorting Algorithm Visualizer
🌙
Algorithm
Bubble Sort (O(n²))
Selection Sort (O(n²))
Insertion Sort (O(n²))
Merge Sort (O(n log n))
Quick Sort (O(n log n))
Heap Sort (O(n log n))
Radix Sort (O(dn))
Selected: Bubble Sort (O(n²))
Array Type
Random
Reversed
Custom
Array Size: 10
5
30
Generate New Array
Start Sorting
Reset
Array Type:
Random
Size:
10
Steps:
0
89
68
93
25
7
40
37
37
35
91
Comparisons:
0
Swaps:
0
Time:
0s
Array Size:
10
Min Value:
7
Max Value:
93
Algorithm Pseudocode
Bubble Sort
1
for i = 0 to n-1:
2
for j = 0 to n-i-2:
3
if arr[j] > arr[j+1]:
4
swap(arr[j], arr[j+1])
Legend:
Compare
Swap
Sorted
Pivot
Merge