understanding segment tree

segment-tree

#1

Hello guys, I need a little help implementing and understanding segment tree data structure. I have read many online tutorials and I understand the concept pretty well. But when comes to implementing the code, my knowledge falls out of the sky. I am not getting desired output in any of my attempts. What should I do next?


#2

link this tutorial contains implementation.


#3

Refer this


#4

This link contains list of problems along with nice explanation of segment tree. This should clear all your problems :slight_smile:


#5

Try to share the code via ideone link . Any one of us could help you debug it