Top MCQs on MergeSort Algorithm with Answers

Last Updated :
Discuss
Comments

Question 1

Given a list of n string where each string is of length n. The list is sorted into lexicographic order using the Merge Sort algorithm. The worst case running time of this computation is

  • A

    O (n*log(n))

  • B

    O (n2 log n)

  • C

    O (n2 + log(n))

  • D

    O (n2)

Question 2

In a modified merge sort, the input array is splitted at a position one-third of the length(N) of the array. Which of the following is the tightest upper bound on time complexity of this modified Merge Sort.

  • A

    N(logN base 3)

  • B

    N(logN base 2/3)

  • C

    N(logN base 1/3)

  • D

    N(logN base 3/2)

Question 3

Which of the following sorting algorithms has the lowest worst-case complexity?

  • A

    Merge Sort

  • B

    Bubble Sort

  • C

    Quick Sort

  • D

    Selection Sort

Question 4

You have to sort 1 GB of data with only 100 MB of available main memory. Which sorting technique will be most appropriate?
  • A
    Heap sort
  • B
    Merge sort
  • C
    Quick sort
  • D
    Insertion sort

Question 5

Which sorting algorithm will take least time when all elements of input array are identical? Consider typical implementations of sorting algorithms.

  • A

    Insertion Sort

  • B

    Heap Sort

  • C

    Merge Sort

  • D

    Selection Sort

Question 6

Which of the following is true about merge sort?

  • A

    Merge Sort works better than quick sort if data is accessed from slow sequential memory.

  • B

    Merge Sort is stable sort by nature

  • C

    Merge sort outperforms heap sort in most of the practical situations.

  • D

    All of the above.

Question 7

Assume that a mergesort algorithm in the worst case takes 30 seconds for an input of size 64. Which of the following most closely approximates the maximum input size of a problem that can be solved in 6 minutes?

  • A

    256

  • B

    512

  • C

    1024

  • D

    2048

Question 8

What is the best sorting algorithm to use for the elements in array are more than 1 million in general?
  • A
    Merge sort.
  • B
    Bubble sort.
  • C
    Quick sort.
  • D
    Insertion sort.

Question 9

Which of the following is not a stable sorting algorithm in its typical implementation.

  • A

    Insertion Sort

  • B

    Merge Sort

  • C

    Quick Sort

  • D

    Bubble Sort

Question 10

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:

  • A

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

  • B

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

  • C

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

  • D

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

There are 13 questions to complete.

Take a part in the ongoing discussion