Skip to content
Advertisement

Tag: temporary

Wrong Implementation of LinkedList

I am having trouble with the following code segment. I can’t really figure out why it doesn’t work, any help is appreciated. It’s a very very simple mistake that I do not understand: Prints 5 and it keeps printing 5 if you write u.next.next.next.val, what I want is u.val = 5 , u.next.val = 1 and u.next.next = None Answer

Advertisement