https://github.com/soerenmartius/rust-fibonacci
How to calculate the fibonacci sequence in Rust with a Recursion, memoized solution and bottom up approached
https://github.com/soerenmartius/rust-fibonacci
Last synced: 2 months ago
JSON representation
How to calculate the fibonacci sequence in Rust with a Recursion, memoized solution and bottom up approached
- Host: GitHub
- URL: https://github.com/soerenmartius/rust-fibonacci
- Owner: soerenmartius
- License: mit
- Created: 2019-10-04T10:22:10.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2019-10-06T06:42:12.000Z (over 5 years ago)
- Last Synced: 2025-02-07T15:16:10.475Z (4 months ago)
- Language: Rust
- Size: 89.8 KB
- Stars: 0
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# rust-fibonacci
How to calculate the fibonacci sequence in Rust with a Recursion, memoized solution and bottom up approached.
Note: This example runs on Rust nightly because it uses the unstable test feature for benchmarking.
## Solutions
This repository comes with three different solutions of how to solve the fibonacci sequence:
- [Recursive Fibonacci O(2^N)](src/lib.rsL#13)
- [Recursive Fibonacci with Memoization O(N) ( Dynamic Programming Solution )](src/lib.rs#L32)
- [Bottom up approach O(N)](src/lib.rs#L59)## Install Rust Nightly
```bash
rustup install nightly
rustup default nightly
```## Run the tests
```bash
cargo test
```## Run the benchmark tests
```bash
cargo bench
```