UML Diagram:
Node |
- data : TYPE
- ptrPrev : Node<TYPE>*
- ptrNext : Node<TYPE>*
|
|
The Node class must contain the data to be stored, and at least the
pointer to the next Node. For our data structure we will also store
a pointer to the previous node. This makes our list a
Doubly-Linked List instead of a Singly-Linked List.
(Note that the names of variables/classes here might not match 1:1 to
the code lab. You should be able to infer what is what based on similar names.)
|
We can link nodes together without a linked list structure, but we create the LinkedList
to act as the node manager and also provide a public "interface" of functionality (Push, Pop, Get).
