segment tree

can we construct a segment tree without recursion???

Anything Can Be Done Recursively and Non-Recursively. First Google Things Before Posting here you will get plenty of Good Tutorials.

1 Like

Instead of calling the same function for 2n and 2n+1 (or however you iterate through levels) in order to advance to the next segment, you keep a queue or a stack of segments not yet computed and push segments there instead of recursing.