链表
0_o_c
这个作者很懒,什么都没留下…
展开
-
populating-next-right-pointers-in-each-node-ii
1、populating-next-right-pointers-in-each-node-ii 来源:牛客网Follow up for problem "Populating Next Right Pointers in Each Node". What if the given tree could be any binary tree? Would your previous solution原创 2017-10-20 23:17:26 · 242 阅读 · 0 评论 -
linked-list-cycle
1、链接:linked-list-cycle 来源:牛客网 Given a linked list, determine if it has a cycle in it. Follow up: Can you solve it without using extra space?2、思路:设置快慢指针,如果有cycle则会相遇,没有的话,快指针最终会走到tail 3、代码:public cl原创 2017-10-20 22:13:57 · 184 阅读 · 0 评论 -
partition-list
1、来源:partition-list 牛客网Given a linked list and a value x, partition it such that all nodes less than x come before nodes greater than or equal to x. You should preserve the original relative order of t原创 2017-10-24 00:31:44 · 248 阅读 · 0 评论 -
rotate-list
1、来源:rotate-listGiven a list, rotate the list to the right by k places, where k is non-negative. For example: Given1->2->3->4->5->NULLand k =2, return4->5->1->2->3->NULL.2、思路,递归的本质是栈,例子中进栈1、2、3、4、5,原创 2017-10-24 08:55:40 · 221 阅读 · 0 评论