public static void printMaxInWindow(int[] A, int windowSize) {
		Deque<Integer> queue = new LinkedList<Integer>();
		int i = 0;
		
		while (i < windowSize) {
			if (queue.isEmpty() || A[queue.getLast()] > A[i])
				queue.add(i++);
			else
				queue.removeLast();
		}
		
		while (i < A.length) {
			System.out.print(A[queue.peek()] + " ");
			
			while (!queue.isEmpty() && A[queue.getLast()] < A[i])
				queue.removeLast();
			
			if (!queue.isEmpty() && i - queue.peek() >= windowSize)
				queue.removeFirst();
			
			queue.add(i++);
		}
		
		System.out.println(A[queue.peek()]);
	}