- A O(1)
- B O(log n)
- C O(n)
- D O(n log n)
- Share this MCQ
Answer:
D
Explanation:
Merge sort is a divide-and-conquer sorting algorithm that recursively divides the array into smaller subarrays, sorts them individually, and then merges them back together. In each recursive call, the array is split in half, resulting in a logarithmic number of divisions. Afterward, the merging process takes linear time to combine the sorted subarrays. Therefore, the time complexity of merge sort in the worst case is O(n log n).