Bubble Sort algorithm

Bubble Sort is the simplest sorting algorithm that works by iterating through the array from the first index to the last index and comparing adjacent elements and then swapping them if they appear in the wrong order. I.e. If the next element is smaller than the current element, they are swapped.  As it iterates for all the array elements with repeatedly swapping the adjacent elements. … Continue reading Bubble Sort algorithm