摘要: 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 阅读全文
posted @ 2016-03-24 08:59 YuriFLAG 阅读(181) 评论(0) 推荐(0)
摘要: Given a singly linked list, determine if it is a palindrome. Follow up: Could you do it in O(n) time and O(1) space? 思路1:创建一个ArrayList用于保存每个节点的value,遍 阅读全文
posted @ 2016-03-24 08:41 YuriFLAG 阅读(174) 评论(0) 推荐(0)