How do you come up with the thinking of moving the left pointer over until the right is null? I understand this makes the left stop at the node we want to change next for. I hope this question makes sense.
@AlgoJS
Жыл бұрын
When working with linked lists there's a very high chance that you're going to need to use two pointers, then it's just down to pattern recognition. I would recommend looking at the linked list playlist and focus on the various techniques for finding specific nodes. I hope this helps! Let me know if you have any more questions.
@jaday4230
2 жыл бұрын
why do we need dummy node
@AlgoJS
2 жыл бұрын
If we didn't have the dummy node, when traversing the link list the left pointer would be positioned on the node to remove not the node before, leading to the wrong node being deleted. Have another watch from 2:17 - I go into more detail on the use case of the dummy node.
@hikemalliday6007
Жыл бұрын
its a very common strategy when dealing with linked lists. just keep grinding, it will all make sense in time
Пікірлер: 5