|  | 
|  | 
| вернуться в форум | Segment tree. Store a sorted array [L...R]  in each vertex of your ST,  corresponding to [L;R].Re: Segment tree. Hey!Do you mind explaining the Segment tree approach a little bit more? I still couldn't understand
Re: Segment tree. HiIt is frequently called merge sort tree
Re: Segment tree. So there is an array TRANSPORTED[i]If we have want to find some value in interval of array cells from i=l to i=r
 We can do binary search in sorted sequence TRANSPORTED[l], TRANSPORTED[l+1],... TRANSPORTED [r-1], TRANSPORTED[r]
Re: Segment tree. In merge sort treeWe have some sorted subsequences precalculated
 It is possible to represent any subsequence [l..r] as union of O(log(n)) such precalculated subsequences
 | 
 | 
|