In this link https://techdifferences.com/difference-between-bubble-sort-and-selection-sort.html it says that the best case of bubble sort is order of n due to the fact that there would be only comparisons and no swaps in the inner loop.
But is that correct? Are comparisons not counted in the complexity ? Only swaps?
Other sources claim the reason is only because it can be optimized with a ' flag' checking if it entered the inner loop. In that case there would be ZERO swaps and n comparisons. ( If this reason is correct, can't I optimize other sorting algorithms this way? Likesay, selection sort?)
What is the correct reason? I questioned both of the reasons!
EDIT: this is what is said in the link: "In the best case, it is of order n because it just compares the elements and doesn’t swap them"