Merge K Sorted Linkedlist
You are given an array of k linked-lists, each linked-list is sorted in increasing order.Input Format
Merge all the linkedlists into one sorted linkedlist and return it.
3 sorted linkedlist :Output Format
{
0->0->0->null,
0->0->1->1->1->2->2->4->null,
0->0->0->0->5->5->6->null
}
after merging them :Question Video
0->0->0->0->0->0->0->0->0->1->1->1->2->2->4->5->5->6->null
0 <= k <= 10^5Sample Input
0 <= size of linkedlist <= 1000
3Sample Output
3
0 0 0
8
0 0 1 1 1 2 2 4
7
0 0 0 0 5 5 6
0 0 0 0 0 0 0 0 0 1 1 1 2 2 4 5 5 6
-
Asked in Companies
-
Related Topics
Video Solution
Code Solution
{ }
{ }
Run