May 2017
Intermediate to advanced
310 pages
8h 5m
English
We have assumed nodes that have a pointer to the next node. This is probably the simplest type of node. However, depending on our requirements, we can create a number of other types of nodes.
Sometimes we want to go from A to B, but at the same time from B to A. In that case, we add a previous pointer in addition to the next pointer:

As you can see from the figure, we let both the last and the first nodes point to None, to indicate that we have reached they form the boundary of our list end-point. The first node’s previous pointer points to None since it has no predecessor, just as the last item’s next pointer points to
Read now
Unlock full access