Discussion
What is the time complexity of Merge Sort in the worst case ?
Answer: B
Merge sort's worst case is O(n log n).
Merge sort always splits the array in half (about \(\log_2 n\) levels) and merges each level in O(n) time, whatever the input order, so its best, average and worst cases are all \(O(n \log n)\).
\(O(n^2)\) is the worst case of quick sort and simple sorts, O(n) the best case of bubble or insertion sort, and O(log n) binary search.
No comment is present. Be the first to comment.
Loading…
Post your comment
Please log in or register to post a comment.
Examination Categories
- SSC Exams
- Banking Exams
- Teaching Exams
- Civil Services Exams
- Railways Exams
- Engineering Recruitment Exams
- Defence Exams
- State Government Exams
- Police Exams
- Insurance Exams
- Nursing Exams
- Other Government Exams
- NRA CET
- PG Entrance Exams
- Campus Placement
- MBA Entrance Exams
- CUET and UG Entrance
- Judiciary Exams
- Regulatory Body Exams
- Software Development