0 0 votes 25. The algorithm that will efficiently sort an array that is nearly sorted except for the interchange of some adjacent pairs of numbers like : $\{1,3,2,5,4,6\}$ is : A. Quick sort C. Merge sort B. Bubble sort D. Selection sort Algorithms algorithms sorting test-series + – Sanjay Sharma 1.4k views answer comment Share Follow Print 0 reply Please log in or register to add a comment.
0 0 votes infact insertion sort can do it in O(n) time i think.. all others will take relativvely more time. Anusha Motamarri answered Jan 19, 2017 • edited Jan 19, 2017 by Anusha Motamarri Anusha Motamarri comment Share Follow See all 5 Comments 5 5 Comments reply Rahul Jain25 commented Jan 19, 2017 reply Follow flag @anusha still n-1 passes will be done and comparison will be done each time. I tihnk answer should be Insertion short but not in option. And if we go by option then out of all merge sort is better 1 1 replyShare Anusha Motamarri commented Jan 19, 2017 reply Follow flag yeah i was editing it.. i too think the same 1 1 replyShare Rahul Jain25 commented Jan 19, 2017 reply Follow flag Make C) as the answrr 0 0 replyShare Sushant Gokhale commented Jan 24, 2017 reply Follow flag Bubble sort should be the answer. Look at the statement: Adjacent numbers are interchanged Perfect for bubble sort . 1 pass - O(n) 1 1 replyShare cse23 commented Jan 24, 2017 reply Follow flag ya exactly...Bubble sort will do in single pass 1 1 replyShare Please log in or register to add a comment.