May be you can consider creating a 2d array to pre process and store all
the rectangle sums as a dependent subproblem, the sum of larger rect will
be currValuesAdded+OldRectSum. So when you get the coordinate as input u
can calc the needed sum by subtracting sum of big rect and small rect which
is not included in the given coordinates. This can be called constant time
if u don't include the preprocessing time.

On Sat, Aug 11, 2012 at 9:57 PM, adarsh kumar <algog...@gmail.com> wrote:

> Sum of the integers meaning? Do you mind giving an example test case?
>
> regards.
>
> On Sat, Aug 11, 2012 at 7:10 PM, Srividhya <srisam261...@gmail.com> wrote:
>
>> hi all:)
>>
>> The coordinates of a rectangle will be specified. there is a matrix of
>> integers. yo should find the sum of the integers that fall in the region
>> specified by the  coordinates .
>>
>> The solution to be in constant time .
>>
>> --
>> You received this message because you are subscribed to the Google Groups
>> "Algorithm Geeks" group.
>> To view this discussion on the web visit
>> https://groups.google.com/d/msg/algogeeks/-/qHSmXBshmS4J.
>> To post to this group, send email to algogeeks@googlegroups.com.
>> To unsubscribe from this group, send email to
>> algogeeks+unsubscr...@googlegroups.com.
>> For more options, visit this group at
>> http://groups.google.com/group/algogeeks?hl=en.
>>
>
>  --
> You received this message because you are subscribed to the Google Groups
> "Algorithm Geeks" group.
> To post to this group, send email to algogeeks@googlegroups.com.
> To unsubscribe from this group, send email to
> algogeeks+unsubscr...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/algogeeks?hl=en.
>



-- 
Cheers,

  Vicky

-- 
You received this message because you are subscribed to the Google Groups 
"Algorithm Geeks" group.
To post to this group, send email to algogeeks@googlegroups.com.
To unsubscribe from this group, send email to 
algogeeks+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/algogeeks?hl=en.

Reply via email to