We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent aa25e66 commit aae53cbCopy full SHA for aae53cb
1 file changed
23_EntryNodeInListLoop/EntryNodeInListLoop.cpp
@@ -41,7 +41,7 @@ ListNode* EntryNodeOfLoop(ListNode* pHead)
41
if(meetingNode == nullptr)
42
return nullptr;
43
44
- // get the number of nodes in loop
+ // 得到环中结点的数目
45
int nodesInLoop = 1;
46
ListNode* pNode1 = meetingNode;
47
while(pNode1->m_pNext != meetingNode)
@@ -50,12 +50,12 @@ ListNode* EntryNodeOfLoop(ListNode* pHead)
50
++nodesInLoop;
51
}
52
53
- // move pNode1
+ // 先移动pNode1,次数为环中结点的数目
54
pNode1 = pHead;
55
for(int i = 0; i < nodesInLoop; ++i)
56
pNode1 = pNode1->m_pNext;
57
58
- // move pNode1 and pNode2
+ // 再移动pNode1和pNode2
59
ListNode* pNode2 = pHead;
60
while(pNode1 != pNode2)
61
{
0 commit comments