+1 vote
in Class 12 by kratos

What will be the status of the following list after the First. Second and Third pass of the insertion sort method used for arranging the following elements in descending order ?

12,34,46, -34,90,23

Note : Show the status of all the elements after each pass very clearly underlining the changes.

1 Answer

+2 votes
by kratos
 
Best answer

output of diferent passes Pass One

[12,34,46,-34,90,23], {}

Pass Two

[34, 46, -34, 90, 23} , {12}

Pass Three

LISTS MANIPULATION AND IMPLEMENTATION

[46, -34, 90, 23} , {12, 34} Pass Six

Pass Four {23}, {-34,12, 34, 46, 90}

[-34, 90, 23} , { 12, 34, 46} Pass Seven

Pass Five {} , {-34,12, 23, 34, 46, 90}

{90,23} , {-34,12,34,46} It is the sorted list.

...