随笔分类 -  leetcode

摘要:Given a linked list, swap every two adjacent nodes and return its head. For example,Given1->2->3->4, you should return the list as2->1->4->3.Your algo... 阅读全文
posted @ 2014-12-08 19:23 bingtel 阅读(143) 评论(0) 推荐(0)
摘要:Given a linked list, remove thenthnode from the end of list and return its head.For example, Given linked list: 1->2->3->4->5, and n = 2. After re... 阅读全文
posted @ 2014-11-13 16:16 bingtel 阅读(137) 评论(0) 推荐(0)
摘要:Given a linked list and a valuex, partition it such that all nodes less thanxcome before nodes greater than or equal tox.You should preserve the origi... 阅读全文
posted @ 2014-11-13 13:09 bingtel 阅读(116) 评论(0) 推荐(0)
摘要:Given a linked list, return the node where the cycle begins. If there is no cycle, returnnull.Follow up:Can you solve it without using extra space?算法:... 阅读全文
posted @ 2014-11-12 16:19 bingtel 阅读(152) 评论(0) 推荐(0)