Create segment tree