Improved the bubble sort

Only the necessary loops are done. Reduces the best-case complexity to O(n) instead of O(n2).


Valentin Tolmer