[Change] Generic segment tree algo