Code example for Deque

Methods: getFirst

0
maxQ.addLast(data);
	} 
	 
	public int getMax() { 
		return maxQ.getFirst();
	} 
	 
	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();