Generic Segment Tree

In this post, we are going to create a Generic Segment Tree. Before creating a Generic Segment Tree, we will try to solve a basic segment tree problem and try to find what part of our code is problem specific and abstract it out i.e there are some things which are common in any segment tree problem like creating the tree, querying the tree, etc. We will try to identify the piece of logic which is specific to our problem....

February 20, 2021 · 3 min · Vivek Bhadauria