0

Given an array of n elements . Find minimum value of element in range [l...r] such that a[k]> p . ( l<=k<=r and p varies with each l and r).

Is there any solution that works in log(N)?

waka
  • 3,362
  • 9
  • 35
  • 54
  • Make an effort to solve the problem yourself first. Once you've done so, you can explain the problem you're having, include the relevant portions of your work, and ask a specific question. – peacetype Jan 09 '18 at 11:58
  • Getting you through your class is Your task not Ours. That is the reason you go to school. – LosManos Jan 09 '18 at 13:52

1 Answers1

0

PS : I thought of a solution to find(k) number of elements that are less than <= p. And then find the k+1th element in range if the array is sorted.but I am stuck at point update operation for the persistent segment tree for finding the k+1 th element.