Merge k sorted linked lists using divide and conquer with O(n log k) time complexity
Divide-and-conquer pairs up lists and merges: k lists → k/2 lists → k/4 lists → ... → 1 list. With ⌈log k⌉ merge rounds, and n total nodes processed per round, we get O(n log k). The naive approach (merge one at a time) costs O(n × k) because early lists are re-scanned.
Alternative: min-heap of k list heads yields O(n log k) by extracting minimum in O(log k) for each of n nodes. Same complexity, different constant factors.
The divide-and-conquer splits the list array in half recursively, giving O(log k) depth. Each merge operation uses constant extra space (dummy head, tail pointer). The heap approach uses O(k) space for the heap, which may be better or worse depending on k vs. log k.
Iterative pairwise merging (bottom-up) eliminates recursion entirely, achieving O(1) auxiliary space with O(k) pointers to track current lists.