Segment tree - Wikipedia