Code example for Deque

Methods: getFirstremoveFirst

0
	 
	public void dequeue() throws Exception 
	{ 
		if(q.isEmpty()) throw new Exception();
		Integer val = q.poll();
		if(d.getFirst().intValue() == val.intValue())
		{ 
			d.removeFirst();
		} 
		 
	} 
	 
	public Integer max()
	{ 
		return d.getFirst();
	} 
	 
	public static void main(String a[]) throws Exception
	{ 
		QueueMax qm = new QueueMax();
Stop searching for code, let great code find you!  Add Codota to your java IDE