判断单链表是否带环?若带环,求环的长度?求环的入口点?(C语言)

PSListNode HasCycle(PSListNode pHead) { if ((NULL == pHead) || (NULL == pHead->pNextNode)) { return NULL; } else { PSListNode pFast = pHead->pNextNode->pNextNode;
相关文章
相关标签/搜索