factorial of 1000

please help me finding the factorial of 1000 using doubly linked list in c++
Could you post what you're working with, then explain what part you're having trouble with?
I am unable to initiate it ... I can't understand what to do ... actually I have to complete this by today so feeling some depressed
I'm not certain how you'd like us to help you. We can't do it for you; you need to at least attempt something.
Please provide me ready code for atleast multiplication of two numbers using doubly linked list ...
We aren't going to do you work for you. If you aren't willing to put forth any effort, why should I?
Dont leave things to the last second buddy, Shit doesnt end well.

Edit: What butthurt person reported me? I bet its someone who leaves shit to last second and gets it up the butt.
Last edited on
Please provide me ready code for atleast multiplication of two numbers using doubly linked list ...

When I read this, it's like you're asking "please tell me how to make a cup of coffee using a deck of cards." I don't see the connection between the linked list and multiplying numbers. Can you post more information on the assignment, particularly what the linked list ha to do with it. Is it supposed to represent the numbers some how?
closed account (D80DSL3A)
@dhayden. Big integers can be represented in a container by making each element represent 1 or more digits of the big number.
See http://www.cplusplus.com/forum/lounge/32041/ for several examples of bigInt classes built on an underlying std::vector container, etc.
Using a linked list is somewhat reasonable (maybe even good) as the arithmetic operations are carried out digit by digit by iterating over the elements.

@dinesh9293
You don't need to write a bigInt*bigInt function for this problem.
A simpler bigInt *= int will do.
The simplest way I've found to approach your specific problem is to allow each node to store 4 digits of the number, so base = 10,000.

If storing the least significant digits in the head node, then:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
// implement multiplication using the usual "by hand" method
dlist& operator*=( dlist& A, int f )
{
    f %= base;// allowing only a factor smaller than base
    int product = 0;
    int carry = 0;
    dnode* it = A.head;

    while( it )
    {
        product = it->x * f + carry;
        it->x = product%base;
        carry = product/base;
        it = it->next;
    }

    if( carry ) A.push_back( carry );

    return A;
}
thanks bro i have completed
Topic archived. No new replies allowed.