摘要: 这个题简单点,用个head.next.next传下去操作就可以了。 阅读全文
posted @ 2018-03-01 14:38 mayinmiao 阅读(84) 评论(0) 推荐(0) 编辑
摘要: 用快慢指针来判定是否有环。 这里while loop里的条件,用的是fast.next != null && fast.next.next != null,保证如果没有环,slow一定在中点。 阅读全文
posted @ 2018-03-01 14:27 mayinmiao 阅读(96) 评论(0) 推荐(0) 编辑
摘要: While loop 做法: Recursion 做法: 阅读全文
posted @ 2018-03-01 14:17 mayinmiao 阅读(81) 评论(0) 推荐(0) 编辑