You have an array of 100 integers.
There is a window of 10 elements which starts from 0th element and
moves by 1 element till the 90th element.
We need to print the maximum element for all the positions of the
window.

Hint:
For the first position of the window, you have to find the maximum as
done normally for any array.
After that, when the window moves by 1 element, you just have to
consider one more element and forget the very first element to find
the new maximum. Thus, after the first max, it should take much less
time to find the max for all the other window positions.

-- 
You received this message because you are subscribed to the Google Groups 
"Algorithm Geeks" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/algogeeks?hl=en.

Reply via email to