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

237_Delete Node in a Linked List #124

Open
KnightJoker opened this issue Oct 12, 2016 · 2 comments
Open

237_Delete Node in a Linked List #124

KnightJoker opened this issue Oct 12, 2016 · 2 comments

Comments

@KnightJoker
Copy link

请问一下如果这个节点正好是尾节点的时候该怎么处理啊?

@KnightJoker
Copy link
Author

if (!node || !node->next) { return; } node->val = node->next->val; node->next = node->next->next;

这是我的代码,在尾节点的时候,并没有做到删除效果啊- -+

@ar27
Copy link

ar27 commented Dec 18, 2019

The solution does not deal with memory. The removed node is not deleted in this solution.

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

2 participants