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

deleteNodeInALinkedList #11

Open
wants to merge 4 commits into
base: main
Choose a base branch
from
Open

deleteNodeInALinkedList #11

wants to merge 4 commits into from

Conversation

rohinmanvi
Copy link
Contributor

No description provided.

@@ -0,0 +1,4 @@
const deleteNode = (node) => {
node.val = node.next.val;
node.next = node.next.next;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Add comment for why this doesn't break (e.g. if we have 2nd to last node in list, then node.next.next = null, so we set node.next = null, which is what it should be).

@Shreshth3 Shreshth3 force-pushed the main branch 2 times, most recently from e286181 to d69c4be Compare June 9, 2022 18:00
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

Successfully merging this pull request may close these issues.

2 participants