This is the second post on a series about Segment Trees. You can read the first one here , which is an introduction to Segment Trees. If you are comfortable with Segment Trees already, then we can get to a more advanced technique called Lazy Updates. This technique allows for interval-updating operations. Suppose we have the array $$[5, 2, 4, 6, 11, 8, 3, 2]$$ and we want to update all elements between the indexes $$[4, 7]$$ to be $$1$$, and then do some RMQ queries over the Segment Tree.
Read full article from » Segment Trees – Lazy UpdatesSport Coder
No comments:
Post a Comment