Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Recursive Fibonacci sequence

Implement the Fibonacci sequence recursively.

fibonacci(0) = 0
fibonacci(1) = 1

fibonacci(n) = fibonacci(n-1) + fibonacci(n-2)