BUBBLE SORT

Bubble sort is the simplest sorting algorithm and it is based on the idea that every adjacent elements are compared and swapped if found in wrong order.

EXAMPLE:

To understand the bubble sort ,lets consider an unsorted array[1,23,10,-2] and discuss each step taken to sort the array ascending order. In every pass, two adjacent elements are checked and swapped if found in wrong order.

Steps:-