Hi! can anyone help me in solving this situation in <=o(nlogn)
Given an array of integers,in each step,i want to compute maximum number in array
the step is defined as follows-
in the beginning of each step we select maximum number(output for this step) in current array
After this we remove the number and both its adjacent numbers,and in their place we will put min(adjacent numbers) .
we can see that at each step(except extreme elements) the number of elements goes down by 2;
we hve to complete this process till array is empty
EX … 4 9 7… ->… 4… (9 goes to answer for this step);
*ignoring edge cases