Re:Is this the simplest (and most surprising) sorting algori...
by labawi on Tuesday October 05, 2021 @01:33PM
(#28762657)
I see where you're going, but your implementation broke the sort.
As for time complexity, it changes from ϴ(n²) to O(n²). Alternatively, you can drop the O-notation and calculate precisely so as to include constant factor speedups, though your algorithm may end up slower in the worst case.
As for time complexity, it changes from ϴ(n²) to O(n²). Alternatively, you can drop the O-notation and calculate precisely so as to include constant factor speedups, though your algorithm may end up slower in the worst case.