persistent segment tree