I was recently up-solving AtCoder Beginner Contest 339 and came across a Persistent Segment Tree Problem G — Smaller Sum.
While implementing my own Persistent Segment Tree. I tried to make it as generic as possible.
Here are few things that I want your help and opinion on: - Is their a more generic way to implement Persistent Segment Tree? - How can you identify if a problem uses Persistent Segment Tree? - Is their a better way to implement custom allocator for Competitive Programming(or for C++/C projects)? - How can I improve my code snippet for Persistent Segment Tree? - How to implement Lazy Persistent Segment Tree? - If anyone solved the above problem with Merge Sort Tree can you explain your approach?