[Haskell-cafe]
Re: Fun with Haskell, runST, MArray, and a few queens.
Hampus Ram
d00ram at dtek.chalmers.se
Thu Mar 4 21:55:33 EST 2004
On Thu, Mar 04 2004, David Sankel wrote:
> The Haskell version takes significantly longer (and it gets worse for
> larger inputs). So it seems that imperative algorithms are much better for
> certain problems.
I say this is a case of bad code. Of course language <foo> is faster and
better if you write horribly bad code in language <bar>.
Taking the first solution found by searching with google I get times
around 0.015s (real) for the Haskell version and 1.7s for your Java
solution (which also seems to be overcomplicated to me).
/Hampus
--
Homepage: http://www.dtek.chalmers.se/~d00ram
E-mail: d00ram at dtek.chalmers.se
"Det är aldrig försent att ge upp"
More information about the Haskell-Cafe
mailing list