Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

哑节点 #84

Open
lovelmh13 opened this issue Jun 22, 2021 · 0 comments
Open

哑节点 #84

lovelmh13 opened this issue Jun 22, 2021 · 0 comments

Comments

@lovelmh13
Copy link
Owner

从链表头部开始处理的时候,添加一个哑节点,哑节点.next 指向真正的链表头。为了避免链表初始化的时候没有可用节点,而且链表构造过程需要指针移动,进而会导致头指针的丢失,无法返回结果。

这个哑节点的值是多少,无所谓。

例题: leetcode 2. 两数相加

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant