The inner loop in the above algorithm finds the location of the next smallest element in the array (the location of the next smallest element in the array).

Previous slide Next slide Back to first slide View graphic version