Bubble Sort
Intro
Bubble sort - one of the slowest sorting algorithms. But let's see why.
It has a time complexity of O(n^2) (n squared). Why?
Because to implement it, we need to use a nested loop. It means we will have a loop inside another loop. That's because, in bubble sort, we need to compare one element with every (almost every) other element and swap them if necessary.