PSListNode FindMidNode(PSListNode pHead)
{if (NULL == pHead){return NULL;}else{//快慢指针,快指针一次循环走两步,慢指针一次循环走一步PSListNode pSlow = pHead;PSListNode pFast = pHead;//注意结束条件得加上NULL != pFast->pNextNode,否则当NULL == pFast->pNextNode时,进入循环,//执行pFast = pFast->pNextNode->pNextNode时会崩溃while ((NULL != pFast) && (NULL != pFast->pNextNode)){pSlow = pSlow->pNextNode;pFast = pFast->pNextNode->pNextNode;}return pSlow;}
}