合并K个排序链表
public static ListNode mergeKListNode(List<ListNode> list){
PriorityQueue<ListNode> queue = new PriorityQueue<>(Comparator.comparing(node -> node.val));
for (ListNode node :list){
queue.add(node);
}
ListNode head = new ListNode(0);
ListNode tail = head;
while(!queue.isEmpty()){
tail.next= queue.poll();
tail = tail.next;
if(tail.next != null){
queue.add(tail.next);
}
}
return head.next;
}