摘要: Given a linked list, determine if it has a cycle in it.Follow up: Can you solve it without using extra space?摘自剑指offer:当用一个指针遍历链表不能解决问题的时候,可以尝试用两个指针来遍... 阅读全文
posted @ 2015-04-16 23:12 niuer++ 阅读(148) 评论(0) 推荐(0)
摘要: Given a singly linked listL:L0→L1→…→Ln-1→Ln,reorder it to:L0→Ln→L1→Ln-1→L2→Ln-2→…You must do this in-place without altering the nodes' values.For exam... 阅读全文
posted @ 2015-04-16 16:10 niuer++ 阅读(193) 评论(0) 推荐(0)