hmm..... :-o On Fri, Jul 2, 2010 at 5:57 PM, Dave <[email protected]> wrote:
> Yes. With a period of 16: > 1/17 = 0.0588235294117647 0588235294117647 0588235294117647 ... > > Dave > > On Jul 2, 5:22 am, jalaj jaiswal <[email protected]> wrote: > > @dave > > is 1/17 recurring...?? > > @abhirup > > now convert float to string ..only part after decimal > > > > now let the string be .346346346..... > > take an auxilarry array a[0--9]..initialize it to zero > > as you encounter update inceremnt a[s[i]-48] > > wheneva you element in tha array becomes 2 > > store i-1 > > now from 0 to i-1 is the desired answer > > > > > > > > > > > > On Fri, Jul 2, 2010 at 3:45 PM, Abhirup Ghosh <[email protected]> > wrote: > > > Can you please elaborate on the solution you have with auxiliary array? > > > > > On Fri, Jul 2, 2010 at 3:53 AM, jalaj jaiswal < > [email protected]> > > > wrote: > > > > > > we are given with Numerator and Denominator. After division we might > get > > > a > > > > recurring decimal points float as the answer. > > > > For example 23.34563456 ... > > > > return 3456 i.e the recurring part > > > > > > i did it by converting the decimal part into string(itoa).. then a > scan > > > to > > > > find the first repeated character ...then outputting the string upto > that > > > > location of first character-1 > > > > i found first repeated character using an auxilarry array[0..9].. > > > > total 3 scans.. O(n) > > > > > > any better solutions please ?? > > > > -- > > > > > > With Regards, > > > > Jalaj Jaiswal > > > > +919026283397 > > > > B.TECH IT > > > > IIIT ALLAHABAD > > > > > > -- > > > > 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]<algogeeks%[email protected]> > <algogeeks%2bunsubscr...@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 [email protected]. > > > To unsubscribe from this group, send email to > > > [email protected]<algogeeks%[email protected]> > <algogeeks%2bunsubscr...@googlegroups.com> > > > . > > > For more options, visit this group at > > >http://groups.google.com/group/algogeeks?hl=en. > > > > -- > > With Regards, > > Jalaj Jaiswal > > +919026283397 > > B.TECH IT > > IIIT ALLAHABAD- Hide quoted text - > > > > - Show quoted text - > > -- > 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]<algogeeks%[email protected]> > . > For more options, visit this group at > http://groups.google.com/group/algogeeks?hl=en. > > -- With Regards, Jalaj Jaiswal +919026283397 B.TECH IT IIIT ALLAHABAD -- 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.
