I have a simple function that calculates the n-th fibonnaci number below:
fibonacci :: Integer -> Integer
fibonacci 0 = 0
fibonacci 1 = 1
fibonacci n = (fibonacci (n-1) ) + (fibonacci (n-2))
But i am interested in a way to count the number of recursions of this function. Any ideas how to do it?
For the base cases, there are no recursions, for everything else, we have two direct recursive calls and those that are invoked from the two.
You can also re-use the
fibonaccicode,