How to print very large Fibonacci numbers eg fib(1000). My approach: When any one of fib(i-1) or fib(i-2) has more than 12 or 13 digits, partition them into groups of 4 digits and put them in a linked list. fib(i-1) is put in list1, fib(i-2) in list2. Perform the addition of these long numbers and overwrite in list2. Now to find next fib list1 is taken as fib(i-2) and list2 as fib(i-1) and this repeats until we approach the given number and finally the result is in list2. As the number of digits goes on increasing, the list is constructed dynamically.
If anyone has an efficient approach pls tell me. -- You received this message because you are subscribed to the Google Groups "Algorithm Geeks" group. To post to this group, send email to algoge...@googlegroups.com. To unsubscribe from this group, send email to algogeeks+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/algogeeks?hl=en.