码迷,mamicode.com
首页 > 其他好文 > 详细

[CareerCup] 2.6 Linked List Cycle 单链表中的环

时间:2015-07-21 22:00:57      阅读:118      评论:0      收藏:0      [点我收藏+]

标签:

 

2.6 Given a circular linked list, implement an algorithm which returns the node at the beginning of the loop.
DEFINITION
Circular linked list: A (corrupt) linked list in which a node‘s next pointer points to an earlier node, so as to make a loop in the linked list.
EXAMPLE
Input: A - > B - > C - > D - > E - > C [the same C as earlier]
Output: C

 

LeetCode中的原题,请参见我之前的博客 Linked List Cycle 单链表中的环 和 Linked List Cycle II 单链表中的环之二

 

[CareerCup] 2.6 Linked List Cycle 单链表中的环

标签:

原文地址:http://www.cnblogs.com/grandyang/p/4665570.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!