MCPcopy Create free account
hub / github.com/PrajaktaSathe/Java / mergeKList

Method mergeKList

Programs/MergeKsortedLists.java:51–62  ·  view source on GitHub ↗
(Node[]arr,int K)

Source from the content-addressed store, hash-verified

49 }
50
51 Node mergeKList(Node[]arr,int K)
52 {
53 //Add your code here.
54 Node ans = null;
55 //Taking pair of sorted linked list and merging them, Storing their start point(head)
56 //in ans reference variable
57 for(Node i : arr)
58 {
59 ans = mergetwolist(i,ans);
60 }
61 return ans;
62 }
63 //Time Complexity : o(n^2)
64 //Space Complexity : o(1)
65}

Callers 1

mainMethod · 0.95

Calls 1

mergetwolistMethod · 0.95

Tested by

no test coverage detected