Saved Bookmarks
| 1. |
Differentiate bubble sort and selection sort. |
|
Answer» 1. Bubble sort: It is a simple sorting method. In this sorting considering two adjascent elements if it is out of order, the elements are interchanged. After the first iteration the largest(in the case of ascending sorting) or smallest (in the case of descending sorting) will be the end of the array. This process continues. 2. Selection sort: In selection sort the array is divided into two parts, the sorted part and unsorted part. First smallest element in the unsorted part is searched and exchanged with the first element. Now there is 2 parts sorted part and unsorted part. This process continues. |
|