Selection sort: In
this technique, the first element is selected andcompared with all
other elements. If any other element is less thanthe first element
swapping should take place.By the end of this comparison, the least
element most top position in the array. This is known as pass1. In pass
II, the second element is selected and compared with all other elements.
Swapping takes place if any other element is less than selected
element. This process continuous until array is sorted.
The no. of passes in array compare to size of array –1.
0 comments:
Post a Comment