链表环的问题

1.判断链表是否有环: while(fast!=slow){ if(fast.next!=nullptr && fast.next.next!=nullptr){ fast=fast->next->next; slow=slow->next; }else{
相关文章
相关标签/搜索