Bubble sort is a sorting algorithm, which arranges elements present in a list in certain order such as ascending(increasing) or descending(decreasing).
Starting with the first element(index = 0), compare the current element with the next element of the array.
If the current element is greater than the next element of the array, swap them.
If the current element is less than the next element, move to the next element. Repeat Step 1.
Time Complexities
Worst Case: O(n*n)
Space Complexities
Worst Case: O(1)
In place: Yes
Stable: Yes