• edited by
1,409 views
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

1 Answer

0 0 votes
infact insertion sort can do it in O(n) time i think.. all others will take relativvely more time.
• edited by
Position:
Show:

Related questions

1 1 vote
1 answers 1 answer
25.8k
25.8k views
Purple asked Jan 27, 2016
25,753 views
If the number of records to be sorted is small, then ...... sorting can be efficient.A. MergeB. HeapC. InsertionD. Bubble
9 9 votes
2 answers 2 answers
23.4k
23.4k views
3 3 votes
3 3 answers
2.5k
2.5k views
Himanshu1 asked Dec 16, 2015
2,546 views
Assume that array $A$ and $B$ both are sorted, each contain ' $N$ ' element. What is the worst case time complexity to find median of $A \cup B$ ?$\mathrm{O}(\log \mathrm...