[PR #517] [CLOSED] Project Euler/problem 08 #937

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

📋 Pull Request Information

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

Base: masterHead: project_euler/problem_08


📝 Commits (5)

  • 0d1eb35 add input data as an ASCII text file
  • 6fa88fe brute-force method - O(n^2)
  • 6dd8824 an optimized solution - O(n) complexity
  • 89a0e98 updating DIRECTORY.md
  • 01c80f1 updating DIRECTORY.md

📊 Changes

4 files changed (+240 additions, -0 deletions)

View changed files

📝 DIRECTORY.md (+3 -0)
project_euler/Problem 08/digits.txt (+20 -0)
project_euler/Problem 08/sol1.c (+100 -0)
project_euler/Problem 08/sol2.c (+117 -0)

📄 Description

Solution to Project Euler problem# 8 using two methods.

  • sol1.c provides an easy to understand method in complexity O(n^2). The algorithm reads each digit almost num_digit times from the file. There are num_digits * total_digits multiplications in all.
  • sol2.c achieves the same objective using a ring buffer and much less computations and in complexity O(n). In fact, it reads each digit only once and there are only total_digits multiplications and total_digits division operations.

🔄 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/517 **Author:** [@kvedala](https://github.com/kvedala) **Created:** 3/30/2020 **Status:** ❌ Closed **Base:** `master` ← **Head:** `project_euler/problem_08` --- ### 📝 Commits (5) - [`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 - [`89a0e98`](https://github.com/TheAlgorithms/C/commit/89a0e98035c86d3cb218d925dc1d7a4811a0966d) updating DIRECTORY.md - [`01c80f1`](https://github.com/TheAlgorithms/C/commit/01c80f1f443c159aa0ced422cfac13d9f8b26576) updating DIRECTORY.md ### 📊 Changes **4 files changed** (+240 additions, -0 deletions) <details> <summary>View changed files</summary> 📝 `DIRECTORY.md` (+3 -0) ➕ `project_euler/Problem 08/digits.txt` (+20 -0) ➕ `project_euler/Problem 08/sol1.c` (+100 -0) ➕ `project_euler/Problem 08/sol2.c` (+117 -0) </details> ### 📄 Description Solution to Project Euler [problem# 8](https://projecteuler.net/problem=8) using two methods. * `sol1.c` provides an easy to understand method in complexity <math>O(n^2)</math>. The algorithm reads each digit almost `num_digit` times from the file. There are `num_digits * total_digits` multiplications in all. * `sol2.c` achieves the same objective using a ring buffer and much less computations and in complexity <math>O(n)</math>. In fact, it reads each digit only once and there are only `total_digits` multiplications and `total_digits` division operations. --- <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:22 +00:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/C#937