In the worst case, the total number of comparisons for Selection Sort is closest to:
n^2/2nn-1n^2n^2/4Selection Sort's implementation is made up of two nested for loops.
The outer for loop is executed n-1 times.
The inner for loop is executed n-i times.
The total cost is the sum of i's
for i goes from 1 to n.