I'm trying to illustrate a doubly linked list problem. this is from an old test i've been studying lately.
The question is as follows:
draw what the final linked after this code:
ListNode n1 = new ListNode();
ListNode n2 = new ListNode();
ListNode n3 = n1;
n1.next = n2;
n3.prev = n1;
n1.next.prev = n3.next;
Where I get lost is the final line of code.
n1.next.prev = n3.next;
here's the solution:
http://www.imagechicken.com/viewpic.php?p=1242322384048558300&x=jpg
can anyone walk me through this one or lead me in a good direction?