45. How many number of comparisons are required in insertion sort to sort a file if the file is sorted in reverse order?
19Comments
tq realy good
ReplyDeleteThis comment has been removed by a blog administrator.
Deletethanks this is very helpful foe me again thanks
Delete
ReplyDeletegood
This comment has been removed by a blog administrator.
ReplyDeleteReally useful information.
ReplyDeleteThnk u Sir. ..This is really useful for Me......
ReplyDeleteMir Ariya...
ReplyDeletethankuu so much ..it is really useful question for university exam.....
This comment has been removed by the author.
ReplyDeleteAns. of 55 should be n^2log(n).
ReplyDeleteAns. of 62 should be bubble sort!
ReplyDeleteYou are right, Sorry it's mistake from my side. So, I have updated the answer
DeleteThanks
Answers of few questions are seriously wrong. Please go through the answers and edit them. -_-.
ReplyDeleteThe list having 8 elements 8,22,7,9,31,19,5,13.. for this, no. of swappings will be 14, not 9. I manually checked it and through program as well.
Another one is question 55, the answer will be n^2logn because the time complexity for merge sort is nlogn and the sort operation is happening for n times, so n*nlogn i.e., n^2logn
See the below example for swapping using bubble sort is
Delete1 : 8, 7, 9, 22, 5, 13, 31 = 4 swaps
2 : 7, 8, 9, 5, 13, 22, 31 = 3 swaps
3 : 7, 8, 5, 9, 13, 22, 31 = 1 swap
4 : 7, 5, 8, 9, 13, 22, 31 = 1 swap
5 : 5, 7, 8, 9, 13, 22, 31 = 1 swap
Total 10 swaps are required to sort the array.
thank u so much for the useful questions with answers
ReplyDeleteQues 63. The correct order of the efficiency of the following sorting algorithms according to their overall running time comparison is
ReplyDeleteA. Insertion>selection>bubble
B. Insertion>bubble>selection
C. Selection>bubble>insertion.
D. bubble>selection>insertion
How the answer id D, It should be B.
Sir set 1 question kaha hai
ReplyDeleteKaha h
ReplyDeleteThanks was very helpful
ReplyDelete