more code for tree
Segment Tree