pNode FindMiddleNode(pList plist)
{
/*
快慢指针,快的两步,慢的一步
*/
pNode pFast = plist;
pNode pSlow = plist;
while (pFast&&pFast->next)
{
pFast = pFast->next->next;
pSlow = pSlow->next;
}
return pSlow;
}
pNode FindMiddleNode(pList plist)
{
/*
快慢指针,快的两步,慢的一步
*/
pNode pFast = plist;
pNode pSlow = plist;
while (pFast&&pFast->next)
{
pFast = pFast->next->next;
pSlow = pSlow->next;
}
return pSlow;
}