-
Notifications
You must be signed in to change notification settings - Fork 114
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
A question about the implementation #24
Comments
Previous item to target will still point to target |
Recall that in our example, |
That works as long as the element is not last in the list. You are basically rewriting the target element to be the same as the next and then deleting the next one, so the result is that the target is deleted. If there is no next element, there is nothing to duplicate and delete. We need a pointer to the previous item in this case, which is what ckwastra pointed out, I think. |
As knowing the node to remove, why traverse the linked list instead of doing something such as:
The text was updated successfully, but these errors were encountered: