GHR Tutorials
Write an algorithm/pseudo-code to generate Fibonacci number
Algorithm Fibonacci(n)
//find nth Fibonacci number
if n=0 return 0
else if n=1 return 1
else return Fibonacci(n-1)+Fibonacci(n-2)
end algorithm
No comments:
Post a Comment
Newer Post
Older Post
Home
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment