摘要:
Given a linked list, return the node where the cycle begins. If there is no cycle, return null. Note: Do not modify the linked list. Follow up:Can you 阅读全文
posted @ 2016-09-13 11:43
咖啡中不塌缩的方糖
阅读(160)
评论(0)
推荐(0)
摘要:
A linked list is given such that each node contains an additional random pointer which could point to any node in the list or null. Return a deep copy 阅读全文
posted @ 2016-09-13 11:13
咖啡中不塌缩的方糖
阅读(160)
评论(0)
推荐(0)
摘要:
Given a linked list, remove the nth node from the end of list and return its head. For example, Note:Given n will always be valid.Try to do this in on 阅读全文
posted @ 2016-09-13 10:35
咖啡中不塌缩的方糖
阅读(132)
评论(0)
推荐(0)
摘要:
Write a program to find the node at which the intersection of two singly linked lists begins. For example, the following two linked lists: begin to in 阅读全文
posted @ 2016-09-13 09:49
咖啡中不塌缩的方糖
阅读(151)
评论(0)
推荐(0)
摘要:
Merge k sorted linked lists and return it as one sorted list. Analyze and describe its complexity. 最简单的思路是利用之前Merge 2 sorted Lists, 逐个相加,但是这种的时间复杂度会更高 阅读全文
posted @ 2016-09-13 09:36
咖啡中不塌缩的方糖
阅读(124)
评论(0)
推荐(0)
摘要:
Sort a linked list in O(n log n) time using constant space complexity. O(n lg n) constant space的常见sort方法有 merge sort, quick sort, heap sort。 quick sor 阅读全文
posted @ 2016-09-13 09:20
咖啡中不塌缩的方糖
阅读(121)
评论(0)
推荐(0)
摘要:
Write a function to delete a node (except the tail) in a singly linked list, given only access to that node. Supposed the linked list is 1 -> 2 -> 3 - 阅读全文
posted @ 2016-09-13 08:46
咖啡中不塌缩的方糖
阅读(85)
评论(0)
推荐(0)
摘要:
Reverse a singly linked list. 解法: linked list 最典型的题型之一。 思路相同,也可以不用哨兵: 阅读全文
posted @ 2016-09-13 08:40
咖啡中不塌缩的方糖
阅读(110)
评论(0)
推荐(0)

浙公网安备 33010602011771号