So, a few months ago, I was working on Euler Tour from the usaco guide website. There, they explained how you could compress a tree into an array of start[] and end[] arrays to build a segment tree on top of it. However, with LCA, they built a RMQ segtree off of the full inorder traversal of the tree, which confused me greatly. After all, in the examples of summing subtrees and updating vertexes, we hadn't needed to do that. Additionally, I was still greatly uncomfortable with changing the size of the segtree, and a segtree with 2 * (2n — 1) memory (I use the iterative version) pissed me off. I didn't do anymore problems on euler tour after that.
Now, however, I returned. The most annoying thing, in my opinion, was how the start[] and end[] arrays were combined so the segtree could be built. Indeed, in my code I wrote the following:
So, I present a way to build the segtree off of only the start[] array.