I use this (C++) function to calculate member n of the fibonacci series:
This is my VB translation (for those who don't know C++)Code:int fib(int n) { if(n == 0 || n == 1) return 1; return fib(n-1) + fib(n-2); }
I hope I got that right.Code:public function fib (n as long) as long if(n = 0 or n = 1) then fib = 1 end if fib = fib (n - 1) + fib (n-2) end function
Now, I want to know how often this recursive function is called for any number n. Can anyone tell me how to calculate this please?
Thx in advance




CornedBee
Reply With Quote