判斷單鏈表是否帶環?若帶環,求環的長度?求環的入口點?(C語言)

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