Segment tree class