[PR #518] [MERGED] Project euler/master #938

Closed
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/518
Author: @kvedala
Created: 3/30/2020
Status: Merged
Merged: 4/13/2020
Merged by: @StepfenShawn

Base: masterHead: project_euler/master


📝 Commits (10+)

  • 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
  • 30bc9a2 brute force method for Euler# 09
  • ebb887a updating DIRECTORY.md
  • 51115bf optimized solution using only one loop
  • 2ab1e55 Merge branch 'project_euler/problem_09' of github.com:kvedala/C into project_euler/problem_09
  • 458404a updating DIRECTORY.md

📊 Changes

15 files changed (+848 additions, -0 deletions)

View changed files

📝 .gitignore (+2 -0)
📝 DIRECTORY.md (+19 -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)
project_euler/Problem 09/sol1.c (+18 -0)
project_euler/Problem 09/sol2.c (+38 -0)
project_euler/Problem 10/sol1.c (+37 -0)
project_euler/Problem 10/sol2.c (+51 -0)
project_euler/Problem 12/sol1.c (+46 -0)
project_euler/Problem 13/num.txt (+100 -0)
project_euler/Problem 13/sol1.c (+136 -0)
project_euler/Problem 14/sol1.c (+74 -0)
project_euler/Problem 15/sol1.c (+35 -0)
project_euler/Problem 16/sol1.c (+55 -0)

📄 Description

Project Euler solutions

Problem 08

  • sol1.c1 uses brute-force method, reads the digits num_digits times. It requires num_digits^2 multiplication operations.
  • sol2.c is optimized and requires only one read and num_digits multiplications and num_digits divisions.

Problem 09

Two solution - sol1.c uses brute force search and sol2.c simplifies the search by creating relations of two unknowns b and c in terms of the search parameter a.

Problem 10

  • update .gitignore to ignore build outputs (*.exe files on windows OS) and visual studio code config folder.
  • sol1.c uses brute force sequential method to search for primes and requires multiple loops.
  • sol2.c uses Sieve of Eratosthenes to simplify the search for primes.

Problem 12

  • compute triangle numbers on the fly and uses a half-loop search for divisors.

Problem 13

  • implemented using numbers of arbitrary length, limited only by memory constrains and time.

Problem 14

  • optimized solution with an option to compile using OpenMP for parallelization

Problem 15

  • compute triangle numbers on the fly and uses a half-loop search for divisors.

Problem 16

  • computes any power of 2 and the sum of its digits.

🔄 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/518 **Author:** [@kvedala](https://github.com/kvedala) **Created:** 3/30/2020 **Status:** ✅ Merged **Merged:** 4/13/2020 **Merged by:** [@StepfenShawn](https://github.com/StepfenShawn) **Base:** `master` ← **Head:** `project_euler/master` --- ### 📝 Commits (10+) - [`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 - [`30bc9a2`](https://github.com/TheAlgorithms/C/commit/30bc9a201fced98b81b893bc43daa456ab0335bc) brute force method for Euler# 09 - [`ebb887a`](https://github.com/TheAlgorithms/C/commit/ebb887a253588604163b7bae2467b3c59523fdfb) updating DIRECTORY.md - [`51115bf`](https://github.com/TheAlgorithms/C/commit/51115bf0b9e5869185d190b100601bf2687b2c39) optimized solution using only one loop - [`2ab1e55`](https://github.com/TheAlgorithms/C/commit/2ab1e5552d7486277944ed897f9fa5cfdf424c23) Merge branch 'project_euler/problem_09' of github.com:kvedala/C into project_euler/problem_09 - [`458404a`](https://github.com/TheAlgorithms/C/commit/458404a6cb1ea9144770c4de4f5a5e9ab50345b5) updating DIRECTORY.md ### 📊 Changes **15 files changed** (+848 additions, -0 deletions) <details> <summary>View changed files</summary> 📝 `.gitignore` (+2 -0) 📝 `DIRECTORY.md` (+19 -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) ➕ `project_euler/Problem 09/sol1.c` (+18 -0) ➕ `project_euler/Problem 09/sol2.c` (+38 -0) ➕ `project_euler/Problem 10/sol1.c` (+37 -0) ➕ `project_euler/Problem 10/sol2.c` (+51 -0) ➕ `project_euler/Problem 12/sol1.c` (+46 -0) ➕ `project_euler/Problem 13/num.txt` (+100 -0) ➕ `project_euler/Problem 13/sol1.c` (+136 -0) ➕ `project_euler/Problem 14/sol1.c` (+74 -0) ➕ `project_euler/Problem 15/sol1.c` (+35 -0) ➕ `project_euler/Problem 16/sol1.c` (+55 -0) </details> ### 📄 Description # Project Euler solutions ## [Problem 08](https://projecteuler.net/problem=8) * `sol1.c1` uses brute-force method, reads the digits `num_digits` times. It requires `num_digits^2` multiplication operations. * `sol2.c` is optimized and requires only one read and `num_digits` multiplications and `num_digits` divisions. ## [Problem 09](https://projecteuler.net/problem=9) Two solution - `sol1.c` uses brute force search and `sol2.c` simplifies the search by creating relations of two unknowns `b` and `c` in terms of the search parameter `a`. ## [Problem 10](https://projecteuler.net/problem=10) * update `.gitignore` to ignore build outputs (*.exe files on windows OS) and visual studio code config folder. * `sol1.c` uses brute force sequential method to search for primes and requires multiple loops. * `sol2.c` uses Sieve of Eratosthenes to simplify the search for primes. ## [Problem 12](https://projecteuler.net/problem=12) * compute triangle numbers on the fly and uses a half-loop search for divisors. ## [Problem 13](https://projecteuler.net/problem=13) * implemented using numbers of arbitrary length, limited only by memory constrains and time. ## [Problem 14](https://projecteuler.net/problem=14) * optimized solution with an option to compile using OpenMP for parallelization ## [Problem 15](https://projecteuler.net/problem=15) * compute triangle numbers on the fly and uses a half-loop search for divisors. ## [Problem 16](https://projecteuler.net/problem=16) * computes any power of 2 and the sum of its digits. --- <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#938