Bubble Sort
Repeatedly steps through the list, compares adjacent elements and swaps them if they are in the wrong order. Return the sorted array.
Bubble Sort

Repeatedly steps through the list, compares adjacent elements and swaps them if they are in the wrong order. Return the sorted array.

Example 1:
Input: [64,34,25,12,22,11,90]
Output: [11,12,22,25,34,64,90]
Input
arr =[64,34,25,12,22,11,90]
640341252123224115906
Variables
VariableValue
n7
DepthFunction Call
1bubbleSort(arr=[7])
0/91