take an long array of integer (to store the answer)
let Mod=10000 (maximum allowable size or number in the array element
initialize the last element of array with 1
and know start multiplying the 1--n into the last number to first of array
if any number crosses the given then take
 m=a[i]/mod
and set a[i]=a[i]%Mod;
 and add m to the next adjacent element

eg let calculating 5!
taken an array of integer and Mod=10
A={0,0,1}
mutliplying 1 in all from the back side
A={0,0,1}
multiplying 2
A={0,0,2}
multiplying 3
A={0,0,6}
multiplying 4
the number in the last element goes 24
so setting 24%10 =4 stetting it into the that element and adding
24/10=2 to the next
A=[0,2,4}
multiplying 5
4*5=20(setting 0 and adding 2 to next}
2*5+2=12(setting 2 and adding 1 to next)
0*5+1=1
so A={1,2,0}


On Sat, May 1, 2010 at 3:06 PM, divya <[email protected]> wrote:
> give an algo to calculate 300! or even 400!
>
> --
> You received this message because you are subscribed to the Google Groups 
> "Algorithm Geeks" group.
> To post to this group, send email to [email protected].
> To unsubscribe from this group, send email to 
> [email protected].
> For more options, visit this group at 
> http://groups.google.com/group/algogeeks?hl=en.
>
>



-- 
~~~~BL/\CK_D!AMOND~~~~~~~~

-- 
You received this message because you are subscribed to the Google Groups 
"Algorithm Geeks" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/algogeeks?hl=en.

Reply via email to