Bubble Sort is a simple comparison based sorting algorithm.
It sorts the elements by comparing the adjacent elements and re-arranging them if they are in the wrong order.
After every iteration the highest element moves to the end of the array.
It has best case complexity of O(n), average and worst case complexity of O($n^2$).