vincenzopalazzo / cpstl

Copy and Paste standard library (CPSTL) is a repository with a collection of data structure and algorithms in many different languages
https://docs.page/vincenzopalazzo/cpstl
GNU General Public License v2.0
14 stars 3 forks source link

Improve Lazy propagation inside the implementation #5

Closed vincenzopalazzo closed 3 years ago

vincenzopalazzo commented 3 years ago

I would like to test some improvement in the lazy propagation of the segment tree

vincenzopalazzo commented 3 years ago

The idea is to append the value to the lazy array, for instance lazy[pos] += value, and only when I will call the query function, I need to propagate the value.

In this case, I have a problem where I can propagate the value, and maybe my idea is not very good.

The idea to make this experiment in my free time is to store the range in addition to the value to be able to propagate the update in the query time and not in the update time.

vincenzopalazzo commented 3 years ago

Wrong consideration