Thursday, October 27, 2011 No. 15 - Fibonacci Sequences Problem: Please implement a function which returns the nth number in Fibonacci sequences with an input n. Fibonacci sequence is defined as: Analysis: It is a classic interview questions to get numbers in Fibonacci sequences. We have different solutions for it, and their performance varies a lot. Solution 1: Inefficient recursive solution Fibonacci sequences are taken as examples to lecture recursive functions in many C/C++ textbooks, so most of candidates are familiar with the recursive solution.
Read full article from Coding Interview Questions: No. 15 - Fibonacci Sequences
No comments:
Post a Comment