Home > Back-end >  Factorial large Numbers, using singly linked lists
Factorial large Numbers, using singly linked lists

Time:10-14

How to use singly linked lists as big number factorial, studies is the c + +, my freshman year now a sophomore, is learning data structure, the requirement to answer don't too deep, and the more I learn about, this is the problem in the data structure, and the great god help!!!!!!

CodePudding user response:

Asked to answer don't too deep, and the more I learn about

CodePudding user response:

See a lot of operations with a bit operations of large number, very troublesome, there is a way a little performance loss, but is much more simple, is to define a n into the system, such as the definition of a 32767 base, consider an int type a, a linked list node of a, when the data in a linked list node more than 32767, is divided by integer in 32767 before a linked list node in the data, the node data modulus, such a doubling of memory, of course, can take a operation results in 64 in the middle of the variable, then calculate carry, can be set to 2 31 power minus 1 into the system, in addition to increase performance, best set two-way linked list,

CodePudding user response:

Can be achieved with a simple C language,
  • Related