Analyzing the Performance of the Selection Sort Algorithm
- In an array of size n, count how many times an array
element is visited
- To find the smallest, visit n elements + 2 visits for
the swap
- To find the next smallest, visit (n - 1) elements + 2
visits for the swap
- The last term is 2 elements visited to find the smallest + 2
visits for the swap