Summary
Dealing with a doubly linked list.
When CurrentNode is the tail of the list, after setting CurrentNode.Next to NewNode, NewNode is now the tail. NewNode’s Previous field should be set to CurrentNode
Please select what you are reporting on:
Verse
What Type of Bug are you experiencing?
Documentation
Steps to Reproduce
Just before the heading “Removing Nodes” and right after “you have to remember to set the Previous reference for each node as well”,
Click expand code and look at AddNodeAfter function
Expected Result
set CurrentNode.Next = option{NewNode}
set NewNode.Previous = option{CurrentNode}
Observed Result
set CurrentNode.Next = option{NewNode}
Platform(s)
Website