[Haskell-beginners] Efficient Binary Multiplication

KC kc1956 at gmail.com
Wed Apr 18 19:07:06 UTC 2018


Hi

Must you use only lists?

Must each node only contain one digit?

--
Sent from an expensive device which will be obsolete in a few months
Casey

On Sat, Apr 14, 2018, 1:30 PM Quentin Liu, <quentin.liu.0415 at gmail.com>
wrote:

> 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
> _______________________________________________
> Beginners mailing list
> Beginners at haskell.org
> http://mail.haskell.org/cgi-bin/mailman/listinfo/beginners
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.haskell.org/pipermail/beginners/attachments/20180418/a05313fd/attachment.html>


More information about the Beginners mailing list