[PR #516] [CLOSED] + faster Fibonacci number #934

Open
opened 2026-01-29 15:16:20 +00:00 by claunia · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/TheAlgorithms/C/pull/516
Author: @kvedala
Created: 3/29/2020
Status: Closed

Base: masterHead: master


📝 Commits (10+)

  • 959e25c add commandline option to FibonacciDP.c
  • 83bfb72 print hashes in HEX
  • fce50a9 add commandline option to FibonacciDP.c
  • fba36e3 print hashes in HEX
  • bc28239 Merge branch 'master' of github.com:kvedala/C
  • fa73fcb +a much faster fibonacci computation algorithm
  • a3b126a updating DIRECTORY.md
  • 0d1eb35 add input data as an ASCII text file
  • 6fa88fe brute-force method - O(n^2)
  • 6dd8824 an optimized solution - O(n) complexity

📊 Changes

38 files changed (+2147 additions, -40 deletions)

View changed files

📝 .gitignore (+3 -0)
.gitmodules (+3 -0)
.travis.yml (+27 -0)
CMakeLists.txt (+26 -0)
📝 DIRECTORY.md (+34 -0)
📝 README.md (+1 -0)
conversions/CMakeLists.txt (+16 -0)
function_timer (+1 -0)
📝 hash/test_program.c (+6 -8)
misc/CMakeLists.txt (+16 -0)
📝 misc/Fibonacci_DP.c (+8 -3)
misc/Fibonacci_fast.c (+76 -0)
📝 misc/QUARTILE.c (+29 -27)
misc/factorial_fast.c (+67 -0)
project_euler/CMakeLists.txt (+26 -0)
project_euler/Problem 08/digits.txt (+20 -0)
project_euler/Problem 08/sol1.c (+100 -0)
project_euler/Problem 08/sol2.c (+119 -0)
project_euler/Problem 09/sol1.c (+18 -0)
project_euler/Problem 09/sol2.c (+38 -0)

...and 18 more files

📄 Description

New

  • misc/Fibonacci_fast.c: Fast Fibonacci number computation with less memory and processing power using the recursive relations:
    fibonacci relation 1
    fibonacci relation 2

Updated

  • File misc/Fibonacci_DP.c now also accepts command-line input
  • File hash/test_program.c now prints the hash in hexadecimal format

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/TheAlgorithms/C/pull/516 **Author:** [@kvedala](https://github.com/kvedala) **Created:** 3/29/2020 **Status:** ❌ Closed **Base:** `master` ← **Head:** `master` --- ### 📝 Commits (10+) - [`959e25c`](https://github.com/TheAlgorithms/C/commit/959e25ca08f19b8877c119170632774a32d1960e) add commandline option to FibonacciDP.c - [`83bfb72`](https://github.com/TheAlgorithms/C/commit/83bfb72fcf0f7140085a08b29b502fc46930df29) print hashes in HEX - [`fce50a9`](https://github.com/TheAlgorithms/C/commit/fce50a9d7c6a6a35e6b06b9e77a4b43f0dec3085) add commandline option to FibonacciDP.c - [`fba36e3`](https://github.com/TheAlgorithms/C/commit/fba36e3b15b24480ab3c30e6d850c73c36ca3b3d) print hashes in HEX - [`bc28239`](https://github.com/TheAlgorithms/C/commit/bc28239a154aaccadccc0c7604cf56e981a1f1c0) Merge branch 'master' of github.com:kvedala/C - [`fa73fcb`](https://github.com/TheAlgorithms/C/commit/fa73fcb98392a8adb209175616b7cf6de300a0dd) +a much faster fibonacci computation algorithm - [`a3b126a`](https://github.com/TheAlgorithms/C/commit/a3b126aee5756ce5d59ae379edc8a104f1f22446) updating DIRECTORY.md - [`0d1eb35`](https://github.com/TheAlgorithms/C/commit/0d1eb3551dde42600a7233012485620df5439a7f) add input data as an ASCII text file - [`6fa88fe`](https://github.com/TheAlgorithms/C/commit/6fa88fea3556d06e5c49a3e614265a5ffd923253) brute-force method - O(n^2) - [`6dd8824`](https://github.com/TheAlgorithms/C/commit/6dd882487e2ef0ec0d4a7b61452d2a426eca02ee) an optimized solution - O(n) complexity ### 📊 Changes **38 files changed** (+2147 additions, -40 deletions) <details> <summary>View changed files</summary> 📝 `.gitignore` (+3 -0) ➕ `.gitmodules` (+3 -0) ➕ `.travis.yml` (+27 -0) ➕ `CMakeLists.txt` (+26 -0) 📝 `DIRECTORY.md` (+34 -0) 📝 `README.md` (+1 -0) ➕ `conversions/CMakeLists.txt` (+16 -0) ➕ `function_timer` (+1 -0) 📝 `hash/test_program.c` (+6 -8) ➕ `misc/CMakeLists.txt` (+16 -0) 📝 `misc/Fibonacci_DP.c` (+8 -3) ➕ `misc/Fibonacci_fast.c` (+76 -0) 📝 `misc/QUARTILE.c` (+29 -27) ➕ `misc/factorial_fast.c` (+67 -0) ➕ `project_euler/CMakeLists.txt` (+26 -0) ➕ `project_euler/Problem 08/digits.txt` (+20 -0) ➕ `project_euler/Problem 08/sol1.c` (+100 -0) ➕ `project_euler/Problem 08/sol2.c` (+119 -0) ➕ `project_euler/Problem 09/sol1.c` (+18 -0) ➕ `project_euler/Problem 09/sol2.c` (+38 -0) _...and 18 more files_ </details> ### 📄 Description ## New * `misc/Fibonacci_fast.c`: Fast Fibonacci number computation with less memory and processing power using the [recursive relations](https://en.wikipedia.org/wiki/Fibonacci_number#Matrix_form): ![fibonacci relation 1](https://render.githubusercontent.com/render/math?math=F(2n-1)=F^2(n)%2bF^2(n-1)) ![fibonacci relation 2](https://render.githubusercontent.com/render/math?math=F(2n)=F(n)\cdot\left[2F(n-1)%2bF(n)\right]) ## Updated * File `misc/Fibonacci_DP.c` now also accepts command-line input * File `hash/test_program.c` now prints the hash in hexadecimal format --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
claunia added the pull-request label 2026-01-29 15:16:20 +00:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/C#934