int mypow(int x,int m) { if(m==0) return 1; if(m==1) return x; return mypow(x,ceil((float)m/2))*mypow(x,m/2); }
On Sat, Jul 30, 2011 at 1:02 PM, arvind kumar <arvindk...@gmail.com> wrote: > Find the least time complexity algorithm(most efficient algo) to find > x^m(x to the power of m)..Facebok intern interview question! > > -- > 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. > > -- 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.