segment tree

Правка en2, от vsanjay_nitdgp, 2015-08-15 13:20:08

i used the following lazy propogation to update my tree...like i wanted to get sum of [i,j]

http://ideone.com/Vh05zS

my input was n=8;all elements set to zero.'0'.

then i gave my array number 26 to update array from i=1 to i=3;[1,3]

but i am getting tree[1]=52 instead of 78....

could any one say where i am getting wrong.....

thanks in advance

Теги data structure, segment tree, #trees

История

 
 
 
 
Правки
 
 
  Rev. Язык Кто Когда Δ Комментарий
en2 Английский vsanjay_nitdgp 2015-08-15 13:20:08 12 Tiny change: 'deone.com/L8GQjo\n\n\nmy i' -> 'deone.com/Vh05zS\n\n\nmy i'
en1 Английский vsanjay_nitdgp 2015-08-15 13:04:42 378 Initial revision (published)