July 2018
Beginner
202 pages
5h 4m
English
We need to modify the Java node class to support the doubly linked list structure.
A doubly linked list is a linked list in which each node contains a relation to the following and previous nodes. Modify the preceding code in Snippet 2.13 to support this.
The following code shows the solution to this:
public class DblLinkedListNode<V> { private V value; private DblLinkedListNode<V> next; private DblLinkedListNode<V> previous; public DblLinkedListNode(V value, DblLinkedListNode<V> next, DblLinkedListNode<V> previous) { this.value = value; this.next = next; this.previous = previous; }}
Read now
Unlock full access