|
|
O(q n lg n) |
|
|
|
|
about `findClosest()', it should be similar to lower_bound() upper_bound() not going to bother to debug it. |
by the way, ¿is it safe to return 0 when the range is outside the segment? ¿is not going to bother your "merge"? |
|
|
|
|
|
|
|
|
|
|
|
|
root is on row .size()-1, not on 0 |
|
|
2 3 | 1 4 | 5 12 | 6 |
|
|