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