Bubble sort works by going through the list and each time swapping an element one after another. On each pass through the list, one of the number is sorted to its corrected position. Until the whole list is traversed and it's sorted.
The complexity of this algorithm is
O(n^2) which is really bad, and this kind of algorithm is rarely used in actual use cases, it is one of the simplest algorithms to understand, so we'll go through it.