+3 votes
in Class 12 by kratos

Consider the following key set: 42, 29, 74, 11, 65, 58, use insertion sort to sort the data in ascending order and indicate the sequences of steps required.

1 Answer

+5 votes
by kratos
 
Best answer

Insertion sort:

Step-1 - ∞, 42, 29, 74, 11, 65, 58

Step-2 - ∞, 29, 42, 74, 11, 65, 58

Step-2 - ∞, 29, 42, 11, 74, 65, 58

Step-4 - ∞, 29, 42, 11, 65, 74, 58

Step-5 - ∞, 29, 42, 11, 58, 65, 74

Step-6 - ∞, 11, 29, 42, 58, 65, 74

...