BACK_TO_HOME
ALGOVIZ // BUBBLE_SORT

Algorithm Description

Bubble Sort

Bubble Sort is the simplest sorting algorithm that works by repeatedly swapping the adjacent elements if they are in wrong order. This process is repeated until the array is sorted. Though simple, it is highly inefficient for large datasets due to its O(n²) time complexity.

Active Comparison
Element Swap
Sorted Position

Complexity Analysis

TIME COMPLEXITY (AVG)
O(n²)
SPACE COMPLEXITY
O(1)
ReadyLn 0, Col 1
50 Elements50ms LatencyUTF-8