摘要: 题目 Given a linked list, determine if it has a cycle in it. Follow up: Can you solve it without using extra space? 分析 判断链表是否有环,采用快慢指针,如果相遇则表示有环 AC代码 阅读全文
posted @ 2017-07-31 21:03 lepeCoder 阅读(234) 评论(0) 推荐(0) 编辑
摘要: 题目 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 阅读全文
posted @ 2017-07-31 20:26 lepeCoder 阅读(256) 评论(0) 推荐(0) 编辑
摘要: 原题 Given a singly linked list L: 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. 阅读全文
posted @ 2017-07-31 18:04 lepeCoder 阅读(204) 评论(0) 推荐(0) 编辑