February 2020
Beginner to intermediate
616 pages
15h 16m
English
In this recipe, we will learn how to create a doubly linked list and how to traverse its elements in FIFO and LIFO order. As we explained in the introduction to this chapter, the node of a doubly linked list consists of two pointers: one points forward, while the other points backward. The pointer pointing forward is usually called next and is used to point at the next node. The other, which is pointing backward, is usually called prev and is used to point at the previous node.
Traversal in FIFO order means the elements of the doubly linked list are displayed in the order in which they were added to the list. Traversal is done by making use of the next pointer of the node.
Traversal in LIFO order ...
Read now
Unlock full access