摘要:
class Solution { public ListNode swapPairs(ListNode head) { ListNode dummy = new ListNode(-1); ListNode p = dummy; dummy.next = head; while(p != null 阅读全文
posted @ 2020-11-09 21:08
0xcf
阅读(89)
评论(0)
推荐(0)
摘要:
思路 使用队列将每个链表元素放入,每次获取最小的元素加入到链表中 实现代码 class Solution { public ListNode mergeKLists(ListNode[] lists) { Queue<ListNode> heap = new PriorityQueue<>(new 阅读全文
posted @ 2020-11-09 20:54
0xcf
阅读(88)
评论(0)
推荐(0)

浙公网安备 33010602011771号