grokking-algorithms/chapter2/README.md
2024-02-06 21:53:17 +00:00

8 lines
252 B
Markdown
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

# Selection Sort
We have to perform N swaps a total of N times. This takes N^N steps, therefore:
This algorithm has time complexity `O(N^2)`
Technically (`n 1, n - 2 ... 2, 1` ~= N/2) swaps are performed but in BigO the constants are dropped.