Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- =begin
- Sucesión de fibonacci utilizando
- recursividad en Ruby
- =end
- def fibonacci_recursivo(posicion)
- if posicion < 2
- return posicion
- end
- return fibonacci_recursivo(posicion - 1) + fibonacci_recursivo(posicion - 2)
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement