Skip to content

Files

Latest commit

 

History

History
45 lines (24 loc) · 1.16 KB

instruction.md

File metadata and controls

45 lines (24 loc) · 1.16 KB

Fibonacci number

The Fibonacci numbers are the numbers in the following integer sequence characterized by the fact that every number after the first two is the sum of the two preceding ones:

For example:

[0, 1, 1, 2, 3, 5, 8 ...]

Image of Yaktocat

We want you write Fibonacci class that realize two implementation:

  1. Recursive
  2. Dynamic

Part-1. Dynamic implementation

  1. Look at the file dynamic.py.

  2. Run tests: (you will see that all of them FAILED)

     python3 -m unittest tests/dynamic_fibonacci_test.py
    
  3. Now, implement Fibonacci class, methods in dynamic.py

  4. After running tests all of them should be passed.

  5. Compare your answer with mine located in answers/dynamic_fibonacci.py

Part-2. Recursive implementation

  1. Look at the file brute_force.py.

  2. Run tests: (you will see that all of them FAILED)

     python3 -m unittest tests/brute_force_fibonacci_test.py
    
  3. Now, complete brute_force_fibonacci.py

  4. After running tests all of them should be passed.

  5. Compare your answer with mine located in answers/brute_force_fibonacci.py