摘要: 算法的思想是设定两个指针p, q,其中p每次向前移动一步,q每次向前移动两步。那么如果单链表存在环,则p和q相遇;否则q将首先遇到null。 阅读全文
posted @ 2012-09-25 14:00 hellomsg 阅读(160) 评论(0) 推荐(0)