A girl counting on her left hand’s fingers, u need to tell on which finger she will stop for a giving number. Counting was like 1-thumb, 2-index finger , 3-middle finger, 4-ring finger,5-little finger then 6-ring, 7-middle , 8-index, 9 thumb , 10 -index and so on
Segment Tree | Set 1 (Sum of given range) Let us consider the following problem to understand Segment Trees. We have an array arr[0 . . . n-1]. We should be able to 1 Find the sum of elements from index l to r where 0 <= l <= r <= n-1 2 Change value of a specified element of the array arr[i] = x where 0 <= i <= n-1.
Comments
Post a Comment