This is an implementation of fibonnacci generator with 3 different implementations
This repository contains C implementations for solving the recurrence relation F(n) = F(n-3) + F(n-2) using three different approaches: recursive, memoization, and iterative.
-
Make sure you have GCC (GNU Compiler Collection) installed.
-
Clone this repository and navigate to the project directory: git clone https://github.com/brianckiptoo/recurrence-relation-solver.git cd recurrence-relation-solver
-
Compile the source code for the desired approach:
-
Recursive:
gcc recursive.c -o recursive
-
Memoization:
gcc memoization.c -o memoization
-
Iterative:
gcc iterative.c -o iterative
-
Run the compiled executable: ./recursive ./memoization ./iterative
-
Follow the prompts to input
n
and see the result of F(n) = F(n-3) + F(n-2).
Feel free to fork and submit pull requests.
This project is licensed under the MIT License. See the LICENSE file for details.