链表是否有环
p1 = p2 = h; do{ p1 = p1 ->next; p2 = p2 ->next ->next; }while(p2||p2->next||p1 == p2); if(p1 == p2) return true; eles return false;
当前文章:链表是否有环
当前URL:http://ybzwz.com/article/jjdppd.html
p1 = p2 = h; do{ p1 = p1 ->next; p2 = p2 ->next ->next; }while(p2||p2->next||p1 == p2); if(p1 == p2) return true; eles return false;