1.

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,23Note : Show the status of all the elements after each pass very clearly underlining the changes.

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.



Discussion

No Comment Found

Related InterviewSolutions