multiply link list
can anybody tell me how to multiply two linked lists??
i want to multiply large nos., consisting of hundreds of digit.
i have stored the nos in link list form as one digit per node.
now how to perform the multiplication???
is there any other way to multiply large nos???
Well do you know how to multiply on paper?
Multiply these two digits first, they'll be the ones at the end of your two linked lists.
The result you store at the end of a third linked list.
Rinse and repeat, according to the rules of multiplication.
ya i understand but its highly complicated to implement!!!
You have a couple of doubly linked lists, and you work your way all to the end of one, for each step of the other.
Try it with fixed length arrays first if you're unsure of the algorithm.
If you're just as willing to use C++ instead of C then I've already written an efficient variable-sized large integer class. "varbigint" on my useful classes page of the below site.
Write down how to do it. Given a list of digits An through A0, and Bm through B0, how do I get the product of A and B?
Originally Posted by mradul.exe