≡ Menu

How bubble sort is different from selection sort

You are Here: Home > Computer Subjects > Programming in C Language > …

How bubble sort is different from selection sort.

Ans. In bubble sort we compare two adjacent elements & swap them if they are in descending order. So the largest element goes in last position in each step.
In selection sort at each step we find out minimum element in array & swap it with the element under consideration.

Selection sort shows good performance over Bubble sort.

 

Click Here to Find Latest Jobs and Current Affairs

{ 0 comments… add one }

Leave a Comment