Linked List: Insertion
Task: Insert 25 between 20 and 30
What you are watching
Inserting into a linked list moves nothing. The new node is allocated wherever there is room - drawn below the row, because its position in memory has nothing to do with its position in the list - and two pointers are rewritten: the new node points at 30, then 20 points at the new node. The order of those two writes is not optional.