Enhanced Bidirectional Selection sort is an improvement
and enhancement over Selection sort in terms of stability and
efficiency. Enhanced Bidirectional Selection sort sort the
elements bidirectional by finding the minimum value from left
and maximum from right. At first pass the first minimum
value is copied to 1st position and maximum value is copied to
nth position of another array say B. Both minimum and
maximum value is deleted from the original array say A thus
reducing the comparison by the factor of 2.
In second pass second minimum value is copied to 2nd
position and second maximum element is copied to the (n-1)th
position of array B. Again both values are deleted from array
A. This is repeated until all the elements get copied. This
bidirectional property makes the algorithm stable. In this
algorithm only comparison takes place and requires no
swapping.