Like the title says I need help to display a doubly linked list in a forward order. No matter what I do, I can just get it to display in its regular reverse order.
Here's the code:
public class DoubleLinkedList
{ private Node h;
public DoubleLinkedList()
{ h = new Node();
h.back = null;
h.l = null;
h.next = null;
}
public void showAll()
{ Node p = h.next;
while (p != null)
{ System.out.println(p.l.toString( ));
p = p.next;
}
}
public class Node
{ private StudentListing l;
private Node next;
private Node back;
public Node()
{
}
}
}
And thanks for taking the time to help me.
PS: As you may have noticed I can't use the linkedlist class for this program.