MCQ
Single Best Answer
Easy
QWhat is the time complexity of a merge sort algorithm for sorting an array of n elements in the worst case?
ID: #15267
Time Complexity
192 views
Question Info
#15267Q ID
EasyDifficulty
Time ComplexityTopic
Your Answer
Choose the Best Option
Click any option to instantly check if you're correct.
Correct Answer: Option D
Explanation
Merge sort is a divide-and-conquer sorting algorithm that divides the array into smaller subarrays, recursively sorts them, and merges them to obtain the sorted array. In each recursion, the array is divided in half, resulting in a logarithmic number of levels. At each level, the merge operation combines two sorted subarrays, which takes linear time. Therefore, the time complexity of merge sort in the worst case is O(n log n).
Continue Practice
Share
Share This Question
Challenge a friend or share with your study group.
More from This Topic