Compare with each elements in the range [0: n] and if vector[i] is bigger than vector[i + 1], call swap().
n is the number of elements in vector and it will descending every loop. It means the biggest element moves to the right side. And, there are one suitation that break the loop earily than expected. If no any elements call swap(), it represented all of the elements in vector are sorted.
Time complexity:
Best Case:Ο(n)
Worst Case:Ο(n2)
Average Case:Ο(n2)
P.S. If input is sorted, it still checks once without calling swap()