Multiple choice technology architecture

The complexity of merge sort algorithm is

  1. O(n)

  2. O(log n)

  3. O(n2)

  4. O(n log n)

Reveal answer Fill a bubble to check yourself
D Correct answer
Explanation

Merge sort has O(n log n) complexity because it divides the array in half log n times (the divide step) and merges n elements at each level (the conquer step). This gives n × log n operations.