edited by
22,951 views
48 votes
48 votes

If one uses straight two-way merge sort algorithm to sort the following elements in ascending order:

     $20, \ 47, \ 15, \ 8, \ 9, \ 4, \ 40, \ 30, \ 12, \ 17$

then the order of these elements after second pass of the algorithm is:

  1. $8, \ 9, \ 15, \ 20, \ 47, \ 4, \ 12, \ 17, \ 30, \ 40$

  2. $8, \ 15, \ 20, \ 47, \ 4, \ 9, \ 30, \ 40, \ 12, \ 17$

  3. $15, \ 20, \ 47, \ 4, \ 8, \ 9, \ 12, \ 30, \ 40, \ 17$

  4. $4, \ 8, \ 9, \ 15, \ 20, \ 47, \ 12, \ 17, \ 30, \ 40$

edited by

2 Answers

Best answer
113 votes
113 votes

The answer is B.

edited by
Answer:

Related questions

31 votes
31 votes
3 answers
1
Kathleen asked Sep 23, 2014
5,286 views
Let $A$ be an $n \times n$ matrix such that the elements in each row and each column are arranged in ascending order. Draw a decision tree, which finds $1$st, $2$nd and $...
26 votes
26 votes
2 answers
2
Kathleen asked Sep 23, 2014
9,412 views
A sorting technique is called stable ifit takes $O (n \log n)$ timeit maintains the relative order of occurrence of non-distinct elementsit uses divide and conquer paradi...
53 votes
53 votes
4 answers
3
30 votes
30 votes
5 answers
4
Kathleen asked Sep 23, 2014
9,310 views
If $n$ is a power of $2$, then the minimum number of multiplications needed to compute $a^n$ is$\log_2 n$$\sqrt n$$n-1$$n$