InterviewSolution
| 1. |
Consider an array of elements arr[5]= {5,4,3,2,1} , what are the steps of insertions done while doing insertion sort in the array. |
|
Answer» hm// Sort an arr[] of size ninsertionSort(arr, n)Loop from i = 1 to n-1.……a) PICK element arr[i] and insert it into sorted sequence arr[0…i-1]code:-// C++ PROGRAM for insertion sort #INCLUDE |
|