text: traverse the array from 0 to n - i - 1. Swap if the element found is greater than the next element
code: $ t = $ arr [ $ j ] ; $ arr [ $ j ] = $ arr [ $ j + 1 ] ; $ arr [ $ j + 1 ] = $ t ; $ swapped = True ; } }