SegmentTree segment update
kaiyuhou opened this issue · 2 comments
kaiyuhou commented
Is your feature request related to a problem? Please describe.
No.
Describe the solution you'd like
I have no clear idea.
Describe alternatives you've considered
Using binary index tree instead.
Additional context
For current SegmentTree
implementation, it only supports update for one item at once. Is that possible to update a segment at once? Thank you.
https://github.com/cheran-senthil/PyRival/blob/master/pyrival/data_structures/SegmentTree.py
bjorn-martinsson commented
The data structure you are looking for is called a lazy segment tree.
https://github.com/cheran-senthil/PyRival/blob/master/pyrival/data_structures/LazySegmentTree.py
kaiyuhou commented
Thank you. I solved my question.