Binary Reduction
(Use ListNode as the examlple) Apply binary reduction to a group of lists.
Recursive (top down)
Space Complexity: O(lg(n)), n is the length of lists
Iterative (bottom up)
Space Complexity: O(1)
deprecated code
```java Solution 1 (deprecated) public ListNode mergeKLists(ListNode[] lists) { int totList = lists.length; if(totList==0) return null; while(totList>1) { //decrease by half layer by layer until it reaches 1. for(int i=0; 2*i
Similar Question
LeetCode 23. Merge k Sorted Lists
Last updated