recursive programming
Recently Published Documents


TOTAL DOCUMENTS

43
(FIVE YEARS 4)

H-INDEX

7
(FIVE YEARS 0)

2021 ◽  
Vol 1 (1) ◽  
Author(s):  
Jürgen Gerhard

There are too many examples and programming guides (which, e.g., an internet search for "recursive procedure Fibonacci" will turn up) to count that use Fibonacci numbers as an example to illustrate recursive programming. The motivation for this article is to show why the naive way of doing this is a bad idea, as it is horrendously inefficient. We will exhibit much more efficient ways of computing Fibonacci numbers, both iterative and recursive, and analyze and compare worst case running times and memory usages. Using some mathematical properties of Fibonacci numbers leads to the most efficient method for their computation. For illustration and benchmarking, we will use Maple and its programming language, however, similar behaviour can be demonstrated in almost any other programming language. This exposition combines and explores the mathematical properties of Fibonacci numbers, notions of algorithmic complexity, and efficient Maple programming and profiling techniques, and may be used as an introduction to any of these three subjects. The techniques described can be readily generalized to more general types of linear recurrences with constant coefficients.


2015 ◽  
Vol 25 (1) ◽  
pp. 37-66 ◽  
Author(s):  
Renée McCauley ◽  
Scott Grissom ◽  
Sue Fitzgerald ◽  
Laurie Murphy

Sign in / Sign up

Export Citation Format

Share Document