Code example for Deque

Methods: getFirst, removeFirst

0
	} 
	 
	public int removeFirst() { 
		int data = dataQ.remove();
		 
		if (data == maxQ.getFirst()) {
			maxQ.removeFirst();
		} 
		return data;
	} 
	 
	public static void main(String[] args) {
		QueueWithGetMax q = new QueueWithGetMax();
 
		q.addLast(5);
		q.addLast(4);
		System.out.println(q.maxQ);
		 
		q.addLast(8);
		System.out.println(q.maxQ);