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,
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
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