Write an algorithm for bubble sorting
- Bubble sort is a simple sorting algorithm that repeatedly compares adjacent elements in an array and swaps them if they are in the wrong order. The algorithm works by repeatedly stepping through the array, comparing each pair of adjacent elements and swapping them if they are not in order.
- This process is repeated until no swaps are necessary, at which point the array is sorted.