I guess you could use Kadane's algo replacing addition with multiplication. http://en.wikipedia.org/wiki/Maximum_subarray_problem
On Sep 30, 8:08 am, Abhishek Kumar Singh <[email protected]> wrote: > How will you find the subarray whose product is k in an array of > negative and positive numbers > > efficient algorithm is to be considered, it will be better if time > complexity is O(n) -- You received this message because you are subscribed to the Google Groups "Algorithm Geeks" group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/algogeeks?hl=en.
