Consider the array A[]={5,4,9,1,3}apply the insertion sort to sort the array.consider the cost associated with each sort is 25 rupees, what is the total cost of the insertion sort for sorting the entire array?
A)25
B)50
C)75
D)100
Answers
Answered by
1
When the element 1 reaches the first position of the array two comparisons are only required hence 25 * 2= 50 rupees.
*step 1: 4 6 8 1 3 .
*step 2: 1 4 6 8 3.
Similar questions