just in case... start with: algo(1,0)
On Fri, Sep 30, 2011 at 7:07 PM, Hatta <tmd...@gmail.com> wrote: > char A[] = { 1,2,3,4,5 }; > int algo(int b, int i) { > if(i == sizeof(A)) { return 1; } > int c = A[i]; > int f = algo(b*c, i+1); > A[i] = b*f; > return f*c; > } > > > On Thu, Sep 29, 2011 at 8:26 AM, raju <nikutel...@gmail.com> wrote: >> Given an integer array. { 1,2,3,4,5 } >> Compute array containing elements >> 120,60,40,30,24 (2*3*4*5,1*3*4*5, 1*2*4*5, 1*2*3*5, 1*2*3*4) >> We shouldn't use division operator( / ) >> Time complexity O(n) .. Space complexity O(1) >> >> ~raju >> >> -- >> 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. >> > > > > -- > Hatta > -- Hatta -- 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.