2 ms·
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-not
by labawi 5y ago
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.