Site icon T4Tutorials.com

Merge sort MCQs

1. #1: What is the primary purpose of Merge Sort?

(A) To partition data


(B) To search for an element


(C) To merge two arrays


(D) To sort an array



2. What is the worst-case time complexity of Merge Sort?

(A) O(n)


(B) O(n^2)


(C) O(n log n)


(D) O(log n)



3. Which of the following best describes the Merge Sort algorithm?

(A) It repeatedly swaps adjacent elements.


(B) It selects the smallest element and places it at the beginning.


(C) It recursively divides the array into halves and merges them.


(D) It sorts the array in place without additional memory.



4. What is the best-case time complexity of Merge Sort?

(A) O(n)


(B) O(n log n)


(C) O(n^2)


(D) O(log n)



5. Which of the following is true about the stability of Merge Sort?

(A) It can only sort numerical data.


(B) It is not a stable sorting algorithm.


(C) It is a stable sorting algorithm.


(D) It requires additional memory for stability.



6. What is the space complexity of Merge Sort?

(A) O(1)


(B) O(n log n)


(C) O(n)


(D) O(n^2)



7. Which characteristic makes Merge Sort suitable for large datasets?

(A) It requires minimal memory.


(B) It has a consistent O(n log n) time complexity.


(C) It is a simple algorithm to implement.


(D) It is adaptive for partially sorted data.



8. What is the main disadvantage of Merge Sort?

(A) It is not stable.


(B) It is slower than other sorting algorithms.


(C) It cannot handle large datasets.


(D) It uses extra space for merging.



9. In Merge Sort, how is the array divided?

(A) Into random sizes


(B) Into three equal parts


(C) Into four equal parts


(D) Into two equal parts



10. What happens to the time complexity of Merge Sort for an already sorted array?

(A) It remains O(n log n).


(B) It improves to O(n).


(C) It worsens to O(n^2).


(D) It stays O(log n).



11. Which algorithm is based on a similar concept to Merge Sort?

(A) Quick Sort


(B) Heap Sort


(C) Insertion Sort


(D) None of the above



12. What is the output of Merge Sort if applied to the array [7, 2, 1, 6, 8, 5, 3, 4]?

(A) [6, 7, 1, 2, 5, 8, 3, 4]


(B) [8, 7, 6, 5, 4, 3, 2, 1]


(C) [7, 6, 5, 4, 3, 2, 1, 8]


(D) [1, 2, 3, 4, 5, 6, 7, 8]



13. What is the role of the merge function in Merge Sort?

(A) To divide the array


(B) To combine two sorted arrays


(C) To sort the array


(D) To find the minimum element



14. Which of the following is a key operation in Merge Sort?

(A) Partitioning


(B) Swapping


(C) Selecting


(D) Merging



15. In Merge Sort, what happens during the merge step?

(A) The array is divided into two halves.


(B) Two sorted arrays are combined into one sorted array.


(C) The elements are randomly shuffled.


(D) The smallest element is selected.



16. What is the main characteristic of the Merge Sort algorithm?

(A) It is not recursive.


(B) It sorts elements in place.


(C) It is based on the divide and conquer strategy.


(D) It is an adaptive algorithm.



17. Which of the following arrays would require the most comparisons when sorted using Merge Sort?

(A) Already sorted array


(B) Array with many duplicate elements


(C) Randomly ordered array


(D) Reverse sorted array



18. What is the time complexity of the merge function in Merge Sort?

(A) O(n)


(B) O(1)


(C) O(n log n)


(D) O(n^2)



19. What would be the result of applying Merge Sort to an empty array?

(A) An error will occur.


(B) The algorithm will enter an infinite loop.


(C) The array will be filled with zeros.


(D) The empty array will remain unchanged.



20. What type of sorting is Merge Sort classified as?

(A) Comparison-based sorting


(B) External sorting


(C) In-place sorting


(D) All of the above



21. In Merge Sort, how are elements merged from the two halves?

(A) They are compared and added in order.


(B) They are merged randomly.


(C) They are sorted in descending order.


(D) They are swapped.



 

Data Structures MCQs

Basic Concepts

  1. Introduction to Data Structures
  2. Complexity Analysis MCQs

Linear Data Structures MCQs

  1. Arrays MCQs
  2. Linked Lists MCQs
  3. Stacks MCQs
  4. Queues MCQs

Non-Linear Data Structures MCQs

  1. Trees MCQs
  2. Heaps MCQs
  3. Graphs MCQs

Hashing MCQs MCQs

  1. Hash Tables

Sorting and Searching Algorithms MCQs 

  1. Sorting Algorithms MCQs
  2. Searching Algorithms MCQs

Miscellaneous

  1. Memory Management in data structures MCQs
  2. String Manipulation Algorithms MCQs
  1. Data Structures MCQs 1
  2. Data Structures MCQs 2
  3. Data Structures MCQs 3
  4. Data Structures MCQs 4
  5. Data Structures MCQs 5
  6. Stacks Solved MCQs
  7. Queues MCQs
  8. pointer mcqs
  9. Array MCQs

 

Exit mobile version