[Haskell-beginners] Efficient Binary Multiplication

Quentin Liu quentin.liu.0415 at gmail.com
Sat Apr 14 20:28:55 UTC 2018


Hi all,

Suppose I want to multiply two binary numbers whose representation uses lists (e.g. 14 is represented as [1, 1, 1, 0]). Is there any efficient way to do binary multiplication? The way I could come up with involves a lot of intermediate lists that will be discarded eventually and is extremely inefficient. I know one fast algorithm that uses Array but would it be possible to do the multiplication with only lists?

Regards,
Qingbo Liu
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.haskell.org/pipermail/beginners/attachments/20180414/257fb37f/attachment.html>


More information about the Beginners mailing list