InterviewSolution
Saved Bookmarks
| 1. |
How are insertion sort and selection sort different? |
|
Answer» Both insertion and selection sorting techniques keep TWO sub-lists, sorted and unsorted, and place one element at a time into the sorted sub-list. Insertion sort takes the currently selected element and places it in the sorted ARRAY at the RIGHT point while keeping the insertion sort attributes. Selection sort, on the other hand, looks for the smallest element in an unsorted sub-list and replaces it with the CURRENT element. |
|