mirror of
https://github.com/TheAlgorithms/C.git
synced 2026-02-17 05:54:34 +00:00
[PR #517] [CLOSED] Project Euler/problem 08 #937
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/TheAlgorithms/C/pull/517
Author: @kvedala
Created: 3/30/2020
Status: ❌ Closed
Base:
master← Head:project_euler/problem_08📝 Commits (5)
0d1eb35add input data as an ASCII text file6fa88februte-force method - O(n^2)6dd8824an optimized solution - O(n) complexity89a0e98updating DIRECTORY.md01c80f1updating 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.cprovides an easy to understand method in complexity O(n^2). The algorithm reads each digit almostnum_digittimes from the file. There arenum_digits * total_digitsmultiplications in all.sol2.cachieves 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 onlytotal_digitsmultiplications andtotal_digitsdivision operations.🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.