This is for basic, below-IOI level problemsets. If one knows the top-down, recursive segment tree, it should be sufficient to solve all segment tree problems that don't rely heavily on constant-time optimization, right?
This is for basic, below-IOI level problemsets. If one knows the top-down, recursive segment tree, it should be sufficient to solve all segment tree problems that don't rely heavily on constant-time optimization, right?
I haven't heard of any situation where bottom-up approach can do more than top-bottom. So, yes, if you don't care much about const optimization and coding time, feel free to go with top-bottom approach only. I personally find bottom-up approach shorter to implement.