链表是否有环
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;
分享名称:链表是否有环
当前地址:http://azwzsj.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;