Skip to content

Commit 01a56f6

Browse files
committed
Merge pull request soulmachine#11 from advancedxy/master
change variable name h to dummy to follow name convention
2 parents c4f6258 + c6a7e96 commit 01a56f6

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

C++/chapSorting.tex

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -62,14 +62,14 @@ \subsubsection{代码}
6262
ListNode *mergeTwoLists(ListNode *l1, ListNode *l2) {
6363
if (l1 == nullptr) return l2;
6464
if (l2 == nullptr) return l1;
65-
ListNode h(-1);
66-
ListNode *p = &h;
65+
ListNode dummy(-1);
66+
ListNode *p = &dummy;
6767
for (; l1 != nullptr && l2 != nullptr; p = p->next) {
6868
if (l1->val > l2->val) { p->next = l2; l2 = l2->next; }
6969
else { p->next = l1; l1 = l1->next; }
7070
}
7171
p->next = l1 != nullptr ? l1 : l2;
72-
return h.next;
72+
return dummy.next;
7373
}
7474
};
7575
\end{Code}

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy