문제

Complexity of the operation in the segment tree is equal to the O(logn) on the basis of this can we say that any segment tree is balanced?

도움이 되었습니까?

해결책

If "the operation" you're talking about consists of traversing a path from the root to some leaf, then yes, "having max height of O(log n)" sound like a good balance criteria, I would say even a definition :)

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top