For finding maximum in a given range for an array , we need to construct a seg tree of hight log(n). So, for n queries out time complexity will be O(nlogn).
Now, if out query window size is known before hand, suppose j-i==K, how can I reduce the complexity to (nlogK for finding an minimum for a given range.)? I am unable to code it actually. Can anyone please help. PS: I want to solve it using RMQ only. So please reply considering that. -- 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.
