func treeIndexes(length, rows, nodes int) (ranges []row_index) {
	ranges = make([]row_index, rows)
	offset := (nodes - length)
	remaining := length
	for i := rows - 1; i > 0; i-- {
		ranges[i] = row_index{
			s: offset,
			e: (offset + remaining),
		}
		remaining = (remaining + 1) / 2
		offset = offset - remaining
	}
	ranges[0] = row_index{
		s: 0,
		e: 1,
	}
	return ranges
}
treeIndexes computes the start and end index of each row in the tree
package id
func rowAndSize(l int) (row_count, tree_size int) {
	row_count = 1
	tree_size = 1
	for ; l > 1; l = (l + 1) / 2 {
		row_count++
		tree_size += l
	}
	return row_count, tree_size
}
type row_index struct {
	s int
	e int
}