Hi guys :)) https://www.hackerrank.com/challenges/task-scheduling
I'm trying to solve this problem using segment tree.
I have an array of numbers , I need to add X from index L to R , and also I have to find maximum member of an array from index L to R (not the same L and R);
n---number of elements of an array; The problem I have here is that I want to answer and update this queries in O(lg(n)) time (lg^2(n) will be also okay ) , not O(n);
Can anyone tell me what is an approach to solve this problem ?
P.S in hackkerrank problem R is always N ....
thanks in advance )







+3
