Commit Graph

712 Commits

Author SHA1 Message Date
Krishna Vedala
b20488c091
Project Euler - Problems 8-16
# 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.
2020-03-30 16:06:15 -04:00
github-actions
8db5a47bd0 updating DIRECTORY.md 2020-03-30 19:49:42 +00:00
Krishna Vedala
6ff4ac36d8
Merge branch 'project_euler/problem_16' into project_euler/master
# Conflicts:
#	DIRECTORY.md
2020-03-30 15:49:17 -04:00
Krishna Vedala
772da4e1ac
Merge branch 'project_euler/problem_15' into project_euler/master
# Conflicts:
#	DIRECTORY.md
2020-03-30 15:48:28 -04:00
Krishna Vedala
5e2dbc583b
Merge branch 'project_euler/problem_14' into project_euler/master
# Conflicts:
#	DIRECTORY.md
2020-03-30 15:47:30 -04:00
Krishna Vedala
471d3a9247
Merge branch 'project_euler/problem_13' into project_euler/master
# Conflicts:
#	DIRECTORY.md
2020-03-30 15:46:02 -04:00
github-actions
9f25309c90 updating DIRECTORY.md 2020-03-30 19:43:54 +00:00
Krishna Vedala
079938ea7c
algorithm from http://www.cplusplus.com/forum/beginner/68694/ 2020-03-30 15:43:16 -04:00
github-actions
8d76566b2e updating DIRECTORY.md 2020-03-30 18:50:59 +00:00
Krishna Vedala
1dc71abe93
combinatorial solution 2020-03-30 14:49:54 -04:00
Krishna Vedala
16cc1b71ff
added printf info 2020-03-30 11:42:49 -04:00
github-actions
46e4bf8e5d updating DIRECTORY.md 2020-03-30 15:25:54 +00:00
Krishna Vedala
6bfc6b691a
optimized solution with option to compile using platform independent OpenMP parallelization. 2020-03-30 11:25:15 -04:00
github-actions
7d534ac8f9 updating DIRECTORY.md 2020-03-30 14:49:06 +00:00
Krishna Vedala
944fbbea7c
solution using arbitrary length decimal number addition using array allocation 2020-03-30 10:48:24 -04:00
Krishna Vedala
657c317957
added numbers as a text file 2020-03-30 09:25:07 -04:00
Krishna Vedala
c45653e074
Merge branch 'project_euler/problem_12' into project_euler/master
# Conflicts:
#	DIRECTORY.md
2020-03-30 08:45:31 -04:00
Krishna Vedala
58d1d75958
added algorithm summary in comments 2020-03-30 08:42:43 -04:00
github-actions
f6536cc3be updating DIRECTORY.md 2020-03-30 04:37:29 +00:00
Krishna Vedala
618614e5e1
Merge branch 'project_euler/problem_12' into project_euler/master 2020-03-30 00:36:47 -04:00
Krishna Vedala
51448a7399
Merge branch 'project_euler/problem_10' into project_euler/master
# Conflicts:
#	DIRECTORY.md
2020-03-30 00:36:35 -04:00
Krishna Vedala
058da0b344
Merge branch 'project_euler/problem_09' into project_euler/master
* project_euler/problem_09:
  updating DIRECTORY.md
  optimized solution using only one loop copied from - https://github.com/TheAlgorithms/Python/blob/master/project_euler/problem_09/sol2.py
  updating DIRECTORY.md
  brute force method for Euler# 09

# Conflicts:
#	DIRECTORY.md
2020-03-30 00:33:20 -04:00
Krishna Vedala
5d1ba02868
Merge branch 'project_euler/problem_08' into project_euler/master 2020-03-30 00:27:51 -04:00
github-actions
dc7cbdb768 updating DIRECTORY.md 2020-03-30 04:25:52 +00:00
Krishna Vedala
f6054c5d1c
algorithm implemented as presented in https://github.com/TheAlgorithms/Python/blob/master/project_euler/problem_12/sol2.py 2020-03-30 00:24:22 -04:00
github-actions
2a86cb9b95 updating DIRECTORY.md 2020-03-30 03:23:46 +00:00
Krishna Vedala
bba43f508e
ignore EXE files and vscode settings 2020-03-29 23:22:57 -04:00
Krishna Vedala
ad84e9b08d
fixed bug when n=5000 2020-03-29 23:20:41 -04:00
Krishna Vedala
feaf57d4a3
fixed error when n=5000 2020-03-29 23:13:01 -04:00
Krishna Vedala
747a50d3ca
Euler prob# 10 using sieve of Eratosthenes 2020-03-29 22:23:06 -04:00
Krishna Vedala
266383a700
add new-line to printf 2020-03-29 22:23:05 -04:00
Krishna Vedala
6e6e9e3d7e
brute force method to find primes and add them 2020-03-29 22:23:04 -04:00
github-actions
458404a6cb updating DIRECTORY.md 2020-03-30 01:35:20 +00:00
Krishna Vedala
2ab1e5552d
Merge branch 'project_euler/problem_09' of github.com:kvedala/C into project_euler/problem_09 2020-03-29 21:34:51 -04:00
Krishna Vedala
51115bf0b9
optimized solution using only one loop
copied from - https://github.com/TheAlgorithms/Python/blob/master/project_euler/problem_09/sol2.py
2020-03-29 21:33:58 -04:00
github-actions
ebb887a253 updating DIRECTORY.md 2020-03-30 01:21:21 +00:00
Krishna Vedala
30bc9a201f
brute force method for Euler# 09 2020-03-29 21:20:49 -04:00
github-actions
01c80f1f44
updating DIRECTORY.md 2020-03-29 20:28:47 -04:00
github-actions
89a0e98035
updating DIRECTORY.md 2020-03-29 20:28:47 -04:00
Krishna Vedala
6dd882487e
an optimized solution - O(n) complexity 2020-03-29 20:28:46 -04:00
Krishna Vedala
6fa88fea35
brute-force method - O(n^2) 2020-03-29 20:28:46 -04:00
Krishna Vedala
0d1eb3551d
add input data as an ASCII text file 2020-03-29 20:28:32 -04:00
github-actions
a3b126aee5 updating DIRECTORY.md 2020-03-07 15:58:11 +00:00
Krishna Vedala
fa73fcb983
+a much faster fibonacci computation algorithm 2020-03-07 10:57:52 -05:00
Krishna Vedala
bc28239a15
Merge branch 'master' of github.com:kvedala/C 2020-03-07 10:53:52 -05:00
Krishna Vedala
fba36e3b15
print hashes in HEX 2020-03-07 10:53:41 -05:00
Krishna Vedala
fce50a9d7c
add commandline option to FibonacciDP.c 2020-03-07 10:49:15 -05:00
Krishna Vedala
83bfb72fcf
print hashes in HEX 2020-03-07 10:45:24 -05:00
Krishna Vedala
959e25ca08
add commandline option to FibonacciDP.c 2020-03-07 10:40:44 -05:00
Christian Clauss
90e6ee0771
update_directory_md.yml: Remove GH Actions workaround 2020-01-27 22:37:32 +01:00