Merge sort divides the array into two halves recursively until single elements remain, then merges them back in sorted order. The recurrence relation is: \[ T(n) = 2T(n/2) + O(n) \] - Dividing: $O(1)$ - Merging: $O(n)$ - Depth of recursion: $\log n$ Total time: $O(n) \cdot \log n = O(n \log n)$. This holds for all cases (best, average, worst).
Was this answer helpful?
0
0
Top TS PGECET Computer Science & Information Technology Questions