I am trying to write a dropout stack/queue using a Linked List, I have already done the code for Arrays but I am coming across a problem. I do not understand doubly linked list, specifically creating a pointer the previous.
I believe I have done the push correctly (5 being the max until it resets to front of list)
public void push (T element){
LinearNode<T> node = new LinearNode<T>(element);
if(count == 0)
front = node;
else if(count > 5)
rear = front;
rear.setNext(node);
rear = node;
count++;
}
but when I need to pop out I need to set front to the next item in the stack, or previous. I just dont understand how to make a doubly linked list, I know how to set a next but not a previous...