Skip to content

insertAtBegin method is not working in double linked list in your solution. #32

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

Closed
aswinramakrishnan opened this issue Aug 16, 2020 · 2 comments

Comments

@aswinramakrishnan
Copy link

Hello,

Thanks for the lesson on linked list. I understood it completely.

This should work. Please update.

def insertAtBegin(self, data):
if self.head is None:
node = Node(data, self.head, None)
self.head = node
return
node = Node(data, self.head, None)
node.next = self.head
self.head.prev = node
self.head = node

@codebasics
Copy link
Collaborator

codebasics commented Aug 21, 2020 via email

@dhavalsays
Copy link
Contributor

This is fixed now

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