Selection Sort is an algorithm that sorts an array by repeatedly finding the minimum element from the unsorted portion of the array and swapping it with the first unsorted element. This process is ...
Before the first iteration (i = 0), the subarray arr[0:0] is empty, which trivially satisfies the loop invariant. Hence, the loop invariant holds before the first iteration. The algorithm terminates ...