
16 May
2010
16 May
'10
2:33 p.m.
Daniel Fischer wrote:
Heinrich Apfelmus wrote:
Diego Echeverri wrote:
I believe that the bottleneck is in the addOne function (Specially in the case where you have a bunch of nines). I have rewritten it to use STArray but isn't fast enough. doing: addOne $ B.replicate 500000 'a' takes too much time!
Are you sure that you are using a fast algorithm? For instance, starting with k and counting up until you reach a palindrome is definitely not a good idea; you need to do something cleverer.
Deceived by a name :)
He did something cleverer. His algorithm is good, just the implementation leaves much room for improvement.
Oops, my bad. :-$ Regards, Heinrich Apfelmus -- http://apfelmus.nfshost.com