Explore chapters and articles related to this topic
Introduction
Published in Randall L. Eubank, Ana Kupresanin, Statistical Computing in C++ and R, 2011
Randall L. Eubank, Ana Kupresanin
3.9. Define the Fibonacci numbers F0=F1=1 and Fj=Fj-1+Fj-2,j=2,…Create a C++ function that uses recursion (in the sense of Exercise 3.7 ) to evaluate a portion of the Fibonacci sequence with the number of terms to use in the evaluation being determined from user input.Create an analog of your function from part a) that computes Fibonacci numbers directly via a for loop.Which of the functions from parts a) and b) is faster? Use the C++ clock function from Section 3.8.8 to carry out the comparison.Explain the results from part c). What does this tell you about recursion?Rewrite the recursive Fibonacci function so that whenever it evaluates Fi for some i it stores its value in an array that persists between calls to the function. Make sure that on each call the function firsts checks if the relevant value has already been evaluated and, if so, returns it without any additional work. How does the efficiency compare to naive recursion? To the iterative version? (This technique is called memoization.)
A new optimisation model for the selection of optimal cut-off grade using multi-sequential decision algorithm in open-pit metalliferous deposits
Published in International Journal of Mining, Reclamation and Environment, 2023
Pritam Biswas, Rabindra Kumar Sinha, Phalguni Sen
Here, the multi-sequential decision algorithm has used the memoisation method to determine the global optimal . Memoisation refers to the process of storing values that have already been calculated. The values are stored in the database and subsequently utilised this precomputed value in place of all subsequent recursive calls to execute an efficient polynomial-time algorithm using an intelligent computer model.