list
文章平均质量分 87
木头不是哑巴
这个作者很懒,什么都没留下…
展开
-
23. Merge k Sorted Lists
23. Merge k Sorted ListsYou are given an array ofklinked-listslists, each linked-list is sorted in ascending order.Merge all the linked-lists into one sorted linked-list and return it.Example 1:Input: lists = [[1,4,5],[1,3,4],[2,6]]Output: ...原创 2021-04-09 00:07:13 · 101 阅读 · 0 评论 -
138. Copy List with Random Pointer
138.Copy List with Random PointerA linked list of lengthnis given such that each node contains an additional random pointer, which could point to any node in the list, ornull.Construct adeep copyof the list. The deep copy should consist of exactl...原创 2021-04-08 23:39:21 · 78 阅读 · 0 评论 -
148. Sort List
148.Sort ListGiven theheadof a linked list, returnthe list after sorting it inascending order.Follow up:Can you sort the linked list inO(n logn)time andO(1)memory (i.e. constant space)?Example 1:Input: head = [4,2,1,3]Output: [1,2,...原创 2021-04-08 23:18:45 · 163 阅读 · 0 评论