Bubble Sort Visualizer

0 elements
50%
Comparisons: 0
Swaps: 0
Status: Idle

Bubble Sort Explained

Bubble Sort iteratively compares and swaps adjacent elements, pushing larger values to the end in each pass until the array is fully sorted.

Algorithm Characteristics

  • Time ComplexityO(n²) / O(n)
  • Space ComplexityO(1)
  • StabilityYes
  • AdaptiveYes

Key Properties

  • Compares and swaps adjacent elements in each pass

  • Adaptive: stops early if array is sorted

  • Stable: preserves order of equal elements

  • Simple but inefficient for large datasets

Bubble Sort is best for small or nearly sorted arrays due to its simplicity and adaptability