Problem Statement
Given an array of integers, sort the array in ascending order using the Bubble Sort algorithm.
Approach
We loop through the array n-1 times. In each iteration, we swap adjacent elements if they are out of order. This "bubbles" the largest unsorted element to the end. We repeat until no swaps are needed.
Time & Space Complexity
Time complexity is O(n^2) in the average and worst cases. Space complexity is O(1).
