rahul_1234's blog

By rahul_1234, history, 5 weeks ago, In English,

Can someone provide me segment tree implementation of:

Range update : Add x to range

Finding frequency of a constant in range

I know of solution in sqrt decomposition exist, but I wanted in terms of segment tree (maybe lazy propagation or policy based data structures)?

 
 
 
 
  • Vote: I like it  
  • -16
  • Vote: I do not like it  

»
5 weeks ago, # |
Rev. 2   Vote: I like it 0 Vote: I do not like it

Can someone provide me an understandable code for SQRT decomposition for the above if segment tree can't be provided?