I am facing difficulty in building segment tree. What condition to use during building of tree[index] from tree[2index] and tree[2index+]?
MAX QUERY-1 (Difficulty in building tree). During my tree how to use index to build tree. what condition will be there?
use policy based data structure as a node of segment tree and query every segment in range l to r. time complexity for each query will be log(n)*log(n).
I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.
On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.