|  | 
| 3 | 3 | MATLAB Code: Solve Fibonacci Numbers using **Dynamic Programming**, Memoization Implementation in MATLAB | 
| 4 | 4 | 
 | 
| 5 | 5 | 
 | 
| 6 |  | -1- **Fibo1.m: Fibonacci with Recursive approach:**\ | 
| 7 |  | - * Time Complexity: O(2^n) | 
|  | 6 | +1. **Fibo1.m: Fibonacci with Recursive approach:** | 
|  | 7 | + * Time Complexity: O(2^n) | 
| 8 | 8 |  * Space Complexity: O(2^n) | 
| 9 | 9 | 
 | 
| 10 |  | -2- **Fibo2.m: Fibonacci with Dynamic programming (Memoization):**\ | 
| 11 |  | - * Time Complexity: O(n) | 
|  | 10 | +2. **Fibo2.m: Fibonacci with Dynamic programming (Memoization):** | 
|  | 11 | + * Time Complexity: O(n) | 
| 12 | 12 |  * Space Complexity: O(n) | 
| 13 | 13 | 
 | 
| 14 |  | -3- **Fibo3.m: Fibonacci with Matrix Exponentiation:**\ | 
| 15 |  | -	* Time Complexity: O(log(n)) | 
|  | 14 | +3. **Fibo3.m: Fibonacci with Matrix Exponentiation:** | 
|  | 15 | +	* Time Complexity: O(log(n)) | 
| 16 | 16 | 
 | 
| 17 | 17 | 
 | 
| 18 | 18 | 
 | 
| 19 | 19 | ## How to use | 
| 20 | 20 | 
 | 
| 21 | 21 | Just run the **EVAL.m** file to compare run-time of the following three methods: | 
| 22 | 22 | 
 | 
| 23 |  | -	1- Fibo using _Recursive method_ | 
| 24 |  | -	2- Fibo using _Dynamic programming_ | 
| 25 |  | -	3- Fibo using _Matrix Exponentiation_ (Fastest method) | 
| 26 |  | - | 
|  | 23 | +1. Fibo using ___Recursive method___ | 
|  | 24 | +2. Fibo using ___Dynamic programming___ | 
|  | 25 | +3. Fibo using ___Matrix Exponentiation___ (Fastest method) | 
0 commit comments