Re: [algogeeks] Array Increment Problem

2010-06-15 Thread Anand
Using Segment tree below is the implementation. http://codepad.org/5jVxLmsA On Sat, Jun 12, 2010 at 6:14 AM, Jitendra Kushwaha jitendra.th...@gmail.com wrote: This is direct question of segment tree. read the topcoder's tutorial for segment tree -- Regards Jitendra Kushwaha MNNIT,

Re: [algogeeks] Array Increment Problem

2010-06-12 Thread Jitendra Kushwaha
This is direct question of segment tree. read the topcoder's tutorial for segment tree -- Regards Jitendra Kushwaha MNNIT, Allahabad -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To post to this group, send email to

[algogeeks] Array Increment Problem

2010-06-11 Thread amit
Array Increment Problem Given an array A consisting of 'n' elements. Do the following both operations in O(log n) time using a data structure. Increment (A,i,j,x) : This should increment elements from A to A[j] by value x . Report(A,j) : This should report A[j] Trivially in an array Increment