As compared to selection sort Enhanced Bidirectional
Selection sort avoids swapping and involves comparisons and
assigns the element its correct position in another array.
The total number of comparisons required for finding the
minimum element in Selection sort = the total number of
comparisons required for finding minimum and maximum
value in the Enhanced Bidirectional Selection sort.
While the outer while loop in line number 3 of Enhanced
Bidirectional Selection sort algorithm reduces the number of
passes by N/2 where N is the number of elements.
For sorting N=10 unsorted elements using Enhanced
Bidirectional Selection sort the iteration will be as follows: