Visual Selection Sort

Runtime

Selection sort runs O(n2) because it has a nested loop. Since it has to has to do n steps for each of the n numbers, the runtime is O(n2). It should be noted that the runtime is n2 no matter what the original order of the elements were. Selection sort will always go through all of its steps.