A template for segment trees

Revision en3, by ouuan, 2019-10-10 17:37:15

Are you bored of writing duplicate codes when solving segment tree problems?

Did you find that segment trees have very little difference from each other?

Do you want a template, which allows you to code only the key parts, the parts different from other segment trees?

Then this template may help.

An example of segment add & multiply, segment query for sum modulo p:

codes

For more information (how to use it), please read README.md on Github.

History

 
 
 
 
Revisions
 
 
  Rev. Lang. By When Δ Comment
en3 English ouuan 2019-10-10 17:37:15 43
en2 English ouuan 2019-10-10 10:34:11 3
en1 English ouuan 2019-10-10 10:30:07 1880 Initial revision (published)