4
Contributors
8
Replies
10
Views
6 Years
Discussion Span
Last Post by menonnik
0

But I'm not not searching. I want to perform some operation on the subsets.(which is not sum) So how will string search algorithms help me?
I looked up one algortihm Boyer-Moore algorithm but it's not of any help.

0

That is really dependent of the nature of function applied and if there is overlap with previous answers and recursive function, you can sometimes reverse it to build dynamic programming solution or if it is difficult use memoized recursive function. I have recently done some subrange sums, but not in C.

0

for eg. if we need to find a sub array such that the (sum of the sub array) mod b is atleast equal to k, then what are the sort of functions that we can use?

0

Are all values positive, if not bow you define modulo for negative values?
How many values there are in array?
How big is b, how is range of values, are they random or for example typically small?

0

the values are positive. there can be around 50 values in the array. b can be anything between 1 and 1000000.

But i'm looking for a general algorithm that can be used for all functions not for this one specifically.

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.