What is the overall time complexity of the merge sort algorithm?

  • AO(n log n)
  • BO²(n log n)
  • CO(n log n²)
  • DNone of these
Show answerHide answer

Correct answer A

Merge Sort is a divide and conquer algorithm that splits the array into halves, sorts them recursively, and merges them. Each level of recursion processes n elements, and there are log₂n levels, giving O(n log n) time complexity. It is stable and works well for large datasets. Worst, average, and best case all have O(n log n) complexity.