SELECTION-SORT.A/ n D A:length for j D 1 to n 1 smallest D j for i D j C 1 to n if AŒi < AŒsmallest smallest D i exchange AŒj with AŒsmallest The algorithm maintains the loop invariant that at the start of each iteration of the outer for loop, the subarray AŒ1::j 1 consists of the j 1 smalle