Commit Graph

2841 Commits

Author SHA1 Message Date
lance-pyles
d53fdc29e2
chore: update .gitignore (#6263) 2022-07-23 07:56:59 +05:30
Maxim Smolskiy
c45fb3c294
perf: Project Euler problem 145 solution 1 (#6259)
Improve solution (~30 times - from 900+ seconds to ~30 seconds)

Co-authored-by: github-actions <${GITHUB_ACTOR}@users.noreply.github.com>
2022-07-23 07:23:46 +05:30
U
b3d9281591
Add algorithm for creating Hamming numbers (#4992)
* Added algorithm for creating Hamming numbers series in Python

* Changed to f-string format.

* Added modifications

* Update and rename hamming.py to hamming_numbers.py

* Update hamming_numbers.py

* Update hamming_numbers.py

* Rename maths/series/hamming_numbers.py to maths/hamming_numbers.py

Co-authored-by: John Law <johnlaw.po@gmail.com>
2022-07-17 05:55:29 +08:00
KanakalathaVemuru
e1e7922efa
Add circle sort implementation (#5548)
* Added circle sort implementation

* Added modifications

* Added modifications

* Update circle_sort.py

* Update circle_sort.py

Co-authored-by: Christian Clauss <cclauss@me.com>
Co-authored-by: John Law <johnlaw.po@gmail.com>
2022-07-17 05:42:58 +08:00
Dhruv Manilawala
38dfcd28b5
fix: test failures (#6250)
1. Incorrect function was being imported from the module
2. Testing for exception was not done correctly
2022-07-14 12:54:24 +05:30
lakshmikanth ayyadevara
dcc387631d
Improve prime_check in math modules (#6044)
* improved prime_check

* updating DIRECTORY.md

* included suggested changes

* updating DIRECTORY.md

Co-authored-by: github-actions <${GITHUB_ACTOR}@users.noreply.github.com>
2022-07-11 23:29:27 +08:00
Nikos Giachoudis
f7c58e4c4b
Unify primality checking (#6228)
* renames prime functions and occurances in comments

* changes implementation of primality testing to be uniform

* adds static typing as per conventions

* updating DIRECTORY.md

Co-authored-by: github-actions <${GITHUB_ACTOR}@users.noreply.github.com>
2022-07-11 22:36:57 +08:00
Christian Clauss
dad789d903
Get rid of the Union (#6246)
* Get rid of the Union

* updating DIRECTORY.md

* Get rid of the Union

* Remove the redundant pre-commit runs.

Co-authored-by: github-actions <${GITHUB_ACTOR}@users.noreply.github.com>
2022-07-11 13:11:17 +02:00
Todor Peev
ba129de7f3
Fixes: 6216 | Support vector machines (#6240)
* initial commit

* first implementation of hard margin

* remove debugging print

* many commits squashed because pre-commit was buggy

* more kernels and improved kernel management

* remove unnecessary code + fix names + formatting + doctests

* rename to fit initial naming

* better naming and documentation

* better naming and documentation
2022-07-11 12:42:07 +02:00
Christian Clauss
b75a7c77f8
pre-commit autoupdate: pyupgrade v2.34.0 -> v2.37.0 (#6245)
* pre-commit autoupdate: pyupgrade v2.34.0 -> v2.37.0

* pre-commit run --all-files
2022-07-11 10:19:52 +02:00
Vardhaman
2d5dd6f132
MAINT: Updated f-string method (#6230)
* MAINT: Used f-string method

Updated the code with f-string methods wherever required for a better and cleaner understanding of the code.

* Updated files with f-string method

* Update rsa_key_generator.py

* Update rsa_key_generator.py

* Update elgamal_key_generator.py

* Update lru_cache.py

I don't think this change is efficient but it might tackle the error as the error was due to using long character lines.

* Update lru_cache.py

* Update lru_cache.py

Co-authored-by: cyai <seriesscar@gmail.com>
Co-authored-by: Christian Clauss <cclauss@me.com>
2022-07-07 16:34:07 +02:00
Christian Clauss
0a0f4986e4
Upgrade GitHub Actions (#6236)
* Upgrade GitHub Actions

* updating DIRECTORY.md

Co-authored-by: github-actions <${GITHUB_ACTOR}@users.noreply.github.com>
2022-07-07 05:25:25 +02:00
John Law
9135a1f411
Fix doctests and builds in various files (#6233)
* Fix doctest in hamming distance

* add line break

* try to fix quantum_riper_adder

* fix floating point build
2022-07-06 10:00:05 +02:00
Sedat Aybars Nazlica
89fc7bf0b0
Add hamming distance (#6194)
* Add hamming distance

* Fix doctest

* Refactor

* Raise ValueError when string lengths are different
2022-07-06 15:19:13 +08:00
lovetodevelop
e5d1ff2ea8
Fix tiny spelling error (#6219) 2022-07-04 00:28:53 +08:00
Erik Parmann
4a51244e0f
Remove how-to example for support vector machine (#6201) 2022-06-24 01:00:55 +08:00
Margaret
04bc8f01dd
Wave (#6061)
* Added censor function

* Added censor code

* Added comments to the code

* modified censor function

* added decrypt function

* added cypher and decypher functions, deleted censor and decrypt functions

* Deleted decrypt.py

* Deleted censor.py

* edited the crypt and decrypt files

* Update cypher_txt.py

* Remove the endline in cypher.py

* Removed the print at the end of decypher.py

* added 4 new algorithms

* added tests to the four files

* added type hints for the function variables

* Deleted decode message

* Deleted code message

* Welford average algorithm

* added average welford algorithm

* is_narcissistic added

* added a descriptive name

* added max_sectors algorithm

* added find_unique

* added wave algorithm

* deleting average_welford [ in the wrong pr ]

* deleting is_narcissistic [ is in the wrong pr ]

* deleting max_sectors [ is in the wrong pr ]

* deleting find_unique [ is in the wrong pr ]

* deleting censor [ is in the wrong pr ]

* deleting decrypt [ is in the wrong pr ]

* fixed wave.py 

fixed indentation and followed the bots reccomendations

* fixed wave.py again

* fixing wave.py for the third time.

* fixing wave.py

* merging strings/wave.py

merging the suggestion

Co-authored-by: John Law <johnlaw.po@gmail.com>

Co-authored-by: John Law <johnlaw.po@gmail.com>
2022-06-24 00:47:29 +08:00
yulmam
a80e5aadf3
add highest_response_ratio_next.py (#6183)
* add highest_response_ratio_next.py

* Update highest_response_ratio_next.py

* Update highest_response_ratio_next.py
2022-06-22 12:23:52 +08:00
Nivid Patel
42a80cdaf6
Update basic_maths.py (#6017) 2022-06-22 12:04:18 +08:00
Vcrostin
69cde43ca1
make DIRECTORY.md paths relative Fixes (#6179) (#6190) 2022-06-22 12:01:05 +08:00
이빈
c86aa72cfa
Create non_preemptive_shortest_job_first.py (#6169)
* Create non_preemptive_shortest_job_first.py

* 파일 위치 변경

* Delete non_preemptive_shortest_job_first.py

* delete Korean comments

* change comments, & to and, type annotation

* type annotation

* delete unnecessary comment
2022-06-07 00:44:49 +08:00
DongJoon Cha
a44afc9b7d
Add Multi-Level-Feedback-Queue scheduling algorithm (#6165)
* Add Multi-Level-Feedback-Queue scheduling algorithm

* fix type hint annotation for pre-commit

* Update scheduling/multi_level_feedback_queue.py

Co-authored-by: John Law <johnlaw.po@gmail.com>

* Update scheduling/multi_level_feedback_queue.py

Co-authored-by: John Law <johnlaw.po@gmail.com>

* Update scheduling/multi_level_feedback_queue.py

Co-authored-by: John Law <johnlaw.po@gmail.com>

* Update scheduling/multi_level_feedback_queue.py

* Update scheduling/multi_level_feedback_queue.py

Co-authored-by: John Law <johnlaw.po@gmail.com>

Co-authored-by: John Law <johnlaw.po@gmail.com>
2022-06-05 00:41:52 +08:00
kugiyasan
8004671b98
Add Project Euler 68 Solution (#5552)
* updating DIRECTORY.md

* Project Euler 68 Solution

* updating DIRECTORY.md

* Project Euler 68 Fixed doctests, now at 93% coverage

* Update sol1.py

Co-authored-by: github-actions <${GITHUB_ACTOR}@users.noreply.github.com>
Co-authored-by: kugiyasan <kugiyasan@users.noreply.github.com>
Co-authored-by: John Law <johnlaw.po@gmail.com>
2022-05-27 03:24:23 +08:00
Raine Legary
b8fdd81f28
Add minmum path sum (#5882)
* commit on 'shortest_path_sum'

* minimum_path_sum updated

* commit to 'minimum_path_sum'

* added description to minimum_path_sum

* bot requirements fixed for

* Update minimum_path_sum.py

* Update minimum_path_sum.py

Co-authored-by: John Law <johnlaw.po@gmail.com>
2022-05-25 13:49:54 +08:00
Maxim Smolskiy
de4d98081b
Improve Project Euler problem 145 solution 1 (#6141)
* updating DIRECTORY.md

* Improve solution

* updating DIRECTORY.md

* Fix

Co-authored-by: github-actions <${GITHUB_ACTOR}@users.noreply.github.com>
2022-05-24 09:20:47 +08:00
Luke Banicevic
a28ad3f759
Add Microsoft Excel Column Title to Column Number Conversion (#4849)
* Added excel column title to number algorithm as part of conversions

* Renamed file to better reflect algorithm function

* Removed duplicate file

* Update excel_title_to_column.py

* Update excel_title_to_column.py

Co-authored-by: John Law <johnlaw.po@gmail.com>
2022-05-24 09:18:50 +08:00
dangbb
5bac76d7a5
Fix iter_merge_sort bug (#6153)
* Fixed bug where array length 2 can't be sorted

* Add MCC and DU path test

Add test to conversions/octal_to_decimal.py and sorts\iterative_merge_sort.py

* ""

* Update octal_to_decimal.py

Co-authored-by: John Law <johnlaw.po@gmail.com>
2022-05-21 22:02:53 +08:00
Ikko Ashimine
dceb30aad6
Fix typo in word_occurrence.py (#6154)
word_occurence -> word_occurrence
2022-05-20 12:03:54 +08:00
Aviv Faraj
ec54da34b9
Lorenz transformation - physics (#6097)
* Add files via upload

* Changed print to f-string

Also printed out results in a math notation

* Add files via upload

* Fixes: #4710 provided return type

* File exists in another pull request

* imported radians from math

* Updated file according to pre-commit test

* Updated file

* Updated gamma

* Deleted duplicate file

* removed pi

* reversed tests

* Fixed angle condition

* Modified prints to f-string

* Update horizontal_projectile_motion.py

* Update horizontal_projectile_motion.py

* Fixes #4710 added exceptions and tests

* Added float tests

* Fixed type annotations

* Fixed last annotation

* Fixed annotations

* fixed format

* Revert "fixed format"

This reverts commit 5b0249ac0a.

Undo changes
@wq

* Revert "Fixed annotations"

This reverts commit c37bb95408.

* Revert "Fixed last annotation"

This reverts commit e3678fdead.

* Revert "Fixed type annotations"

This reverts commit 3f2b238c34.

* Revert to 4e2fcaf6fb

* Fixing errors found during pre-commit

* Added gauss law

* Implemented Lorenz tranformation with four vector

* pre-commit fixes

* flake8 fixes

* More flake8 fixes

* Added blank space for flake8

* Added reference

* Trailing whitespace fix

* Replaced argument u with velocity (descriptive name fix)

* Added tests for functions + moved velocity check to beta function

* Modified condition to 'not symbolic' in the transform function

* trainling whitespace fix

* Added type hint for 'smybolic' argument in transform function

* Changed reference to avoid pre-commit fails because of spelling issue related to the URL

* Added tests for gamma and transformation_matrix functions

* Fixed transformation_matrix tests

* Fixed tests on beta and gamma functions
2022-05-16 22:26:19 +08:00
zer0-x
80f1da235b
Add sin function to maths (#5949)
* Add sin function to /maths.

* Fix typo in /maths/sin.py

* Format sin.py to meet the new black rules.

* Some improvements.

* Fix a formating error.
2022-05-16 19:28:30 +08:00
Omkaar
dbee5f072f
Improve code on f-strings and brevity (#6126)
* Update strassen_matrix_multiplication.py

* Update matrix_operation.py

* Update enigma_machine2.py

* Update enigma_machine.py

* Update enigma_machine2.py

* Update rod_cutting.py

* Update external_sort.py

* Update sol1.py

* Update hill_cipher.py

* Update prime_numbers.py

* Update integration_by_simpson_approx.py
2022-05-13 20:51:44 +08:00
Rohan R Bharadwaj
e95ecfaf27
Add missing type annotations for strings directory (#5817)
* Type annotations for `strings/autocomplete_using_trie.py`

* Update autocomplete_using_trie.py

* Update detecting_english_programmatically.py

* Update detecting_english_programmatically.py

* Update frequency_finder.py

* Update frequency_finder.py

* Update frequency_finder.py

* Update word_occurrence.py

* Update frequency_finder.py

* Update z_function.py

* Update z_function.py

* Update frequency_finder.py
2022-05-13 13:55:53 +08:00
eee555
bbb88bb5c2
Fix bug in bucket_sort.py (#6005) 2022-05-13 04:28:51 +08:00
Maxim Smolskiy
562cf31a9a
Improve Project Euler problem 074 solution 2 (#5803)
* Fix statement

* Improve solution

* Fix

* Add tests
2022-05-12 11:48:04 +08:00
Leoriem-code
533eea5afa
fix mypy annotations for arithmetic_analysis (#6040)
* fixed mypy annotations for arithmetic_analysis

* shortened numpy references
2022-05-12 11:35:56 +08:00
Omkaar
e23c18fb5c
Fix typos (#6127) 2022-05-12 11:30:00 +08:00
KerimovEmil
3bff196981
Fix some typos in solution 1 of euler 686 (#6112)
While reading this code I noticed some typos in the doc strings and wanted to fix them.
2022-05-12 11:28:45 +08:00
Simon
8226636ea3
Add the Horn-Schunck algorithm (#5333)
* Added implementation of the Horn-Schunck algorithm

* Cleaner variable names

* added doctests

* Fix doctest

* Update horn_schunck.py

* Update horn_schunck.py

* Update horn_schunck.py

* Update horn_schunck.py

Co-authored-by: John Law <johnlaw.po@gmail.com>
2022-05-03 00:07:29 +08:00
Kunwar Preet Singh
26f2df7622
Add sol for P104 Project Euler (#5257)
* Hacktoberfest: added sol for P104 Project Euler

* bot requests resolved

* pre-commit

* Update sol.py

* Update sol.py

* remove trailing zeroes

* Update sol.py

* Update sol.py

* Update sol.py

Co-authored-by: John Law <johnlaw.po@gmail.com>
2022-05-02 22:12:18 +08:00
Vineet Rao
4bd5494992
Add solution to Problem 145 of Project Euler (#5464)
* Solution to Problem 145 of Project Euler

* Provided more descriptive filename

* Update sol1.py

Co-authored-by: John Law <johnlaw.po@gmail.com>
2022-05-02 21:58:12 +08:00
John Law
7a394411b7
fix black at prefix string (#6122)
* fix black at prefix string

* Type -> type

* Type unused
2022-05-01 15:52:40 +02:00
Shuangchi He
e1ec661d4e
Fix some typos (#6113)
* Fix some typos.

* Update volume.py

Co-authored-by: John Law <johnlaw.po@gmail.com>
2022-05-01 18:44:23 +08:00
Manuel Di Lullo
a7e4b2326a
Add prefix conversions for strings (#5453)
* First commit for add_prefix_conversion

* Class names in CamelCase, str.format() to f-string

* Fixed following pre-commit guidelines

* solved issues with mypy and enum.Enum

* Rename add_prefix_conversion.py to prefix_conversions_string.py

Co-authored-by: John Law <johnlaw.po@gmail.com>
2022-05-01 17:45:08 +08:00
varopxndx
10d0e4ecbf
docs: Fix quicksort & binary tree traversal doc (#4878)
* Fix quicksort doc

* add binary tree traversals doc

* Add link to the reference

* Fix job

* Change url

* Update binary_tree_traversals.md

* Update normal_distribution_quick_sort.md

* Update normal_distribution_quick_sort.md

Co-authored-by: John Law <johnlaw.po@gmail.com>
2022-04-29 01:05:21 +08:00
Paulo S. G. Ferraz
1400cb86ff
Remove duplicate is_prime related functions (#5892)
* Fixes (#5434)

* Update ciphers.rabin_miller.py
         maths.miller_rabin.py

* Fixing ERROR maths/miller_rabin.py - ModuleNotFoundError and changing project_euler's isPrime to is_prime function names

* Update sol1.py

* fix: try to change to list

* fix pre-commit

* fix capital letters

* Update miller_rabin.py

* Update rabin_miller.py

Co-authored-by: John Law <johnlaw.po@gmail.com>
2022-04-09 01:40:45 +08:00
Aviv Faraj
1d3d18bcd2
horizontal motion code physics (#4710)
* Add files via upload

* Changed print to f-string

Also printed out results in a math notation

* Add files via upload

* Fixes: #4710 provided return type

* File exists in another pull request

* imported radians from math

* Updated file according to pre-commit test

* Updated file

* Updated gamma

* Deleted duplicate file

* removed pi

* reversed tests

* Fixed angle condition

* Modified prints to f-string

* Update horizontal_projectile_motion.py

* Update horizontal_projectile_motion.py

* Fixes #4710 added exceptions and tests

* Added float tests

* Fixed type annotations

* Fixed last annotation

* Fixed annotations

* fixed format

* Revert "fixed format"

This reverts commit 5b0249ac0a.

Undo changes
@wq

* Revert "Fixed annotations"

This reverts commit c37bb95408.

* Revert "Fixed last annotation"

This reverts commit e3678fdead.

* Revert "Fixed type annotations"

This reverts commit 3f2b238c34.

* Revert to 4e2fcaf6fb

* Fixing errors found during pre-commit
2022-04-04 15:44:29 +02:00
Harshit Agarwal
1f1daaf1c7
feat: add strings/ngram algorithm (#6074)
* feat: added ngram algorithm
* fix(test): use `math.isclose` to match floating point numbers approximately

Co-authored-by: Christian Clauss <cclauss@me.com>
Co-authored-by: Dhruv Manilawala <dhruvmanila@gmail.com>
2022-04-04 09:06:32 +05:30
Harshit Agarwal
4064bf45f5
fix(pre-commit): update black version (#6075)
black==22.1.0 is breaking the hook. Updating it to 22.3.0 fixes all the issue

Refer: https://github.com/python-poetry/poetry/issues/5375
2022-03-30 08:40:56 +05:30
Anirudh Lakhotia
37200a4b3b
LICENSE: Year change (#5920)
* 📝 Updated year

Fixes: #5916

* Update LICENSE.md

Co-authored-by: John Law <johnlaw.po@gmail.com>
2022-03-16 23:40:48 +08:00
Lukas
7a9b3c7292
Added average absolute deviation (#5951)
* Added average absolute deviation

* Formats program with black

* reruns updated pre commit

* Update average_absolute_deviation.py

Co-authored-by: Christian Clauss <cclauss@me.com>
2022-02-13 18:20:19 +01:00