Finally I was able to answer these quries I - Accepted - Segment Tree :)

Signed-off-by: Vineel Kumar Reddy Kovvuri <vineelkumarreddy@gmail.com>