Commit Graph

3433 Commits

Author SHA1 Message Date
Saksham Chawla
d15bf7d492
Add typing to data_structures/heap/heap_generic.py (#7044)
* Update heap_generic.py

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* Update heap_generic.py

* Update heap_generic.py

* Update heap_generic.py

* Update heap_generic.py

* Update heap_generic.py

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
2022-10-12 18:35:31 +02:00
Martmists
a04a6365de
Add Equal Loudness Filter (#7019)
* Add Equal Loudness Filter

Signed-off-by: Martmists <martmists@gmail.com>

* NoneType return on __init__

Signed-off-by: Martmists <martmists@gmail.com>

* Add data to JSON as requested by @CenTdemeern1 in a not very polite manner

Signed-off-by: Martmists <martmists@gmail.com>

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* 'modernize'

Signed-off-by: Martmists <martmists@gmail.com>

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* Update audio_filters/equal_loudness_filter.py

Co-authored-by: Christian Clauss <cclauss@me.com>

* Update equal_loudness_filter.py

* Update equal_loudness_filter.py

* Finally!!

* Arrgghh

Signed-off-by: Martmists <martmists@gmail.com>
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: Christian Clauss <cclauss@me.com>
2022-10-12 15:19:00 +02:00
Shubhajit Roy
f0d1a42deb
Python program for Carmicheal Number (#6864)
* Add files via upload

Python program to determine whether a number is Carmichael Number or not.

* Rename Carmichael Number.py to carmichael number.py

* Rename carmichael number.py to carmichael_number.py

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* Update carmichael_number.py

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* Create carmichael_number.py

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* Update maths/carmichael_number.py

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: Christian Clauss <cclauss@me.com>
2022-10-12 09:22:23 +02:00
pre-commit-ci[bot]
0a3433eaed
[pre-commit.ci] pre-commit autoupdate (#6940)
* [pre-commit.ci] pre-commit autoupdate

updates:
- [github.com/psf/black: 22.8.0 → 22.10.0](https://github.com/psf/black/compare/22.8.0...22.10.0)
- [github.com/asottile/pyupgrade: v2.38.2 → v3.0.0](https://github.com/asottile/pyupgrade/compare/v2.38.2...v3.0.0)
- [github.com/pre-commit/mirrors-mypy: v0.981 → v0.982](https://github.com/pre-commit/mirrors-mypy/compare/v0.981...v0.982)

* updating DIRECTORY.md

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: github-actions <${GITHUB_ACTOR}@users.noreply.github.com>
2022-10-10 22:04:33 +02:00
Lakshay Roopchandani
51dba4d743
Job sequencing with deadlines (#6854)
* completed optimised code for job sequencing with deadline problem

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* completed optimised code for job sequencing with deadline problem

* completed optimized code for job sequencing with deadline problem

* completed optimised code for job sequencing with deadline problem

* completed optimised code for job sequencing with deadline problem

* completed optimised code for job sequencing with deadline problem

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* completed optimized code for the issue "Job Scheduling with deadlines"

* completed optimized code for the issue "Job Scheduling with deadlines"

* completed optimized code for the issue "Job Scheduling with deadlines"

* Update greedy_methods/job_sequencing_with_deadline.py

Co-authored-by: Christian Clauss <cclauss@me.com>

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* Updated reviews

* Updated reviews

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* Update and rename greedy_methods/job_sequencing_with_deadline.py to scheduling/job_sequencing_with_deadline.py

Co-authored-by: lakshayroop5 <87693528+lavenroop5@users.noreply.github.com>
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: Christian Clauss <cclauss@me.com>
2022-10-09 14:53:44 +02:00
Jordan Rinder
5894554d41
Add Catalan number to maths (#6845)
* Add Catalan number to maths

* updating DIRECTORY.md

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

Co-authored-by: github-actions <${GITHUB_ACTOR}@users.noreply.github.com>
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
2022-10-08 23:28:17 +01:00
Paul
660d2bb66c
Add algorithm for Newton's Law of Gravitation (#6626)
* Add algorithm for Newton's Law of Gravitation

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* Update physics/newtons_law_of_gravitation.py

Co-authored-by: Christian Clauss <cclauss@me.com>

* One and only one argument must be 0

* Update newtons_law_of_gravitation.py

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: Christian Clauss <cclauss@me.com>
2022-10-06 19:19:34 +02:00
Jérome Eertmans
8cce0d463a
refactor: pivot is randomly chosen (#6643)
As described in #6095, this reduces the chances to observe a O(n^2) complexity.

Here, `collection.pop(pivot_index)` is avoided for performance reasons.

Fixes: #6095
2022-10-05 11:32:07 +01:00
Rohan R Bharadwaj
087a3a8d53
lorenz -> lorentz (#6670) 2022-10-04 21:52:49 +02:00
Rohan R Bharadwaj
46842e8c5b
Add missing type hints in matrix directory (#6612)
* Update count_islands_in_matrix.py

* Update matrix_class.py

* Update matrix_operation.py

* Update nth_fibonacci_using_matrix_exponentiation.py

* Update searching_in_sorted_matrix.py

* Update count_islands_in_matrix.py

* Update matrix_class.py

* Update matrix_operation.py

* Update rotate_matrix.py

* Update sherman_morrison.py

* Update spiral_print.py

* Update count_islands_in_matrix.py

* formatting

* formatting

* Update matrix_class.py

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
2022-10-04 20:05:56 +02:00
Tarun Jain
a84fb58271
Discord Server invite (#6663) 2022-10-04 18:40:53 +02:00
Jérome Eertmans
fa49e27d22
fix: remove non-existing user from CODEOWNERS (#6648)
Removes user @mateuszz0000 that does not exist, or seems to have been renamed to @L3str4nge
2022-10-04 12:25:23 +02:00
pre-commit-ci[bot]
756bb268eb
[pre-commit.ci] pre-commit autoupdate (#6629)
* [pre-commit.ci] pre-commit autoupdate

updates:
- [github.com/psf/black: 22.6.0 → 22.8.0](https://github.com/psf/black/compare/22.6.0...22.8.0)
- [github.com/asottile/pyupgrade: v2.37.0 → v2.38.2](https://github.com/asottile/pyupgrade/compare/v2.37.0...v2.38.2)
- https://gitlab.com/pycqa/flake8https://github.com/PyCQA/flake8
- [github.com/PyCQA/flake8: 3.9.2 → 5.0.4](https://github.com/PyCQA/flake8/compare/3.9.2...5.0.4)
- [github.com/pre-commit/mirrors-mypy: v0.961 → v0.981](https://github.com/pre-commit/mirrors-mypy/compare/v0.961...v0.981)
- [github.com/codespell-project/codespell: v2.1.0 → v2.2.1](https://github.com/codespell-project/codespell/compare/v2.1.0...v2.2.1)

* Fix a long line

* Update sol1.py

* Update sol1.py

* lambda_

* Update multi_level_feedback_queue.py

* Update double_ended_queue.py

* Update sequential_minimum_optimization.py

* Update .pre-commit-config.yaml

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: Christian Clauss <cclauss@me.com>
2022-10-03 22:00:45 +02:00
Christian Clauss
e9862adafc
chore: remove pre-commit GHA (#6565)
[`pre-commit.ci` is working](https://results.pre-commit.ci/repo/github/63476337) so let's remove our redundant and less powerful GitHub Action.
2022-10-03 06:57:14 +05:30
AHTESHAM ZAIDI
707809b000
Update astar.py (#6456)
* Update astar.py

Improved comments added punctuations.

* Update astar.py

* Update machine_learning/astar.py

Co-authored-by: Caeden <caedenperelliharris@gmail.com>

* Update astar.py

Co-authored-by: Christian Clauss <cclauss@me.com>
Co-authored-by: Caeden <caedenperelliharris@gmail.com>
2022-10-02 23:55:24 +02:00
Christian Clauss
3d33b36e92
Fix pre-commit.ci: additional_dependencies: [types-requests] (#6559)
* Fix pre-commit.ci: additional_dependencies: [types-requests==2.28.11]

* updating DIRECTORY.md

* Update .pre-commit-config.yaml

* additional_dependencies: [types-requests]

Co-authored-by: github-actions <${GITHUB_ACTOR}@users.noreply.github.com>
2022-10-02 21:59:17 +02:00
Saksham1970
f42b2b8dff
Newton raphson complex (#6545)
* Newton raphson better implementation

* flake8 test passed

* Update arithmetic_analysis/newton_raphson_new.py

Co-authored-by: Christian Clauss <cclauss@me.com>

* added multiline suggestions

Co-authored-by: Christian Clauss <cclauss@me.com>
2022-10-02 19:51:04 +02:00
Daniel Pustotin
8b8fba3459
Improve code complexity for segmented sieve (#6372) 2022-10-02 17:35:02 +01:00
Jerrit Gläsker
50545d10c5
Run length encoding (#6492)
* Removed unused commit

* Added wikipedia url

* Renamed parameter, changed decoding to use list comprehension
2022-10-02 16:57:11 +02:00
Jay Gala
072312bd0a
Added code for Maximum Subarray Sum (#6536)
* Added maximum subarray sum #6519

* fixes: #6519 function names changed as per naming conventions
2022-10-02 16:49:49 +02:00
Dhruv Manilawala
c9f1d09e1a
fix: GitHub requires .yml extension (#6542)
* fix: GitHub requires `.yml` extension

Ref: https://docs.github.com/en/communities/using-templates-to-encourage-useful-issues-and-pull-requests/configuring-issue-templates-for-your-repository#configuring-the-template-chooser

* fix: remove newlines from multiline string

* fix: use textarea for dependencies list input
2022-10-02 18:51:53 +05:30
Dhruv Manilawala
cabd8c6382
feat: basic issue forms (#6533) 2022-10-02 14:19:30 +02:00
RAHUL S H
346b0a8466
Added fetch_quotes.py (#6529)
* Added fetch_quotes.py 

fetches quotes from zenquotes.io api

* Update web_programming/fetch_quotes.py

Co-authored-by: rohanr18 <114707091+rohanr18@users.noreply.github.com>

Co-authored-by: rohanr18 <114707091+rohanr18@users.noreply.github.com>
2022-10-02 12:50:47 +02:00
Debjit Bhowal
a12e6941a6
Fix docstring (#6461)
* fixed wrong algo name to radix sort

* added wiki url

* Added "source" in docstring

* Update radix_sort.py

Co-authored-by: Christian Clauss <cclauss@me.com>
2022-10-01 14:17:15 +02:00
Maxim Smolskiy
a0b0f414ae
Add Project Euler problem 116 solution 1 (#6305)
* Add solution

* updating DIRECTORY.md

* Fix pre-commit

* updating DIRECTORY.md

Co-authored-by: github-actions <${GITHUB_ACTOR}@users.noreply.github.com>
Co-authored-by: John Law <johnlaw.po@gmail.com>
2022-09-24 18:04:00 +01:00
Yannick Brenning
91c671ebab
Fix minor typo and add matrix dimension check (#6367)
* Fix minor typo in comment

* Add matrix dimension check

* Add descriptive comment
2022-09-24 17:46:03 +01:00
Beksultan
5754bd09ff
fix typo (#6375) 2022-09-21 16:37:38 +01:00
Satish Mishra
45d3eabeb5
Add Optimized Shell Sort (#6225)
* Add Optimized Shell Sort

* Added return type

* reformatted

* added shrink_shell.py

* ran directory generator

* Rename shrink_shell.py to shrink_shell_sort.py

Co-authored-by: John Law <johnlaw.po@gmail.com>
2022-09-14 09:43:08 +01:00
Nikos Giachoudis
2104fa7aeb
Unify O(sqrt(N)) is_prime functions under project_euler (#6258)
* fixes #5434

* fixes broken solution

* removes assert

* removes assert

* Apply suggestions from code review

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

* Update project_euler/problem_003/sol1.py

Co-authored-by: John Law <johnlaw.po@gmail.com>
2022-09-14 09:40:04 +01:00
C21
81e30fd33c
Fix Max Fenwick Tree (#6328) 2022-09-14 09:24:55 +01:00
Nikhil Kala
4e4fe95369
chore: remove the PayPal badge (#6348) 2022-09-09 12:09:31 -05:00
Margaret
cbf3c6140a
add the dna algorithm (#6323)
* adding the dna algorithm

* following bot recommendations

following bot recommendations for the indentation

* following bot recommendations

following bot recommendations regarding indentation [ again ]

* following bot recommendations

following bot recommendations regarding indentation [ again. ]

* following bot recommendations

following bot recommendations.
2022-09-05 02:51:11 +01:00
zhexuanl
b1818af517
Add Digital Image Processing Algorithm: Local Binary Pattern (#6294)
* add algorithm local binary pattern

* fix failed test for local binary pattern

* updating DIRECTORY.md

* fix detected precommit-error

* fix precommit error

* final check

* Add descriptive name for parameters  x and y

* Update digital_image_processing/filters/local_binary_pattern.py

Co-authored-by: Christian Clauss <cclauss@me.com>

* Update digital_image_processing/filters/local_binary_pattern.py

Co-authored-by: Christian Clauss <cclauss@me.com>

* Update digital_image_processing/filters/local_binary_pattern.py

Co-authored-by: Christian Clauss <cclauss@me.com>

* Update local_binary_pattern.py

* undo changes made on get_neighbors_pixel()

* files formatted by black

* Update digital_image_processing/filters/local_binary_pattern.py

ok thanks

Co-authored-by: Christian Clauss <cclauss@me.com>

* add test for get_neighbors_pixel() function

* reviewed

* fix  get_neighbors_pixel

* Update test_digital_image_processing.py

* updating DIRECTORY.md

* Create code_quality.yml

* Create code_quality.yml

* Delete code_quality.yml

* Update code_quality.yml

* Delete code_quality.yml

Co-authored-by: github-actions <${GITHUB_ACTOR}@users.noreply.github.com>
Co-authored-by: Christian Clauss <cclauss@me.com>
2022-08-24 06:48:54 +02:00
AmirMohammad Hosseini Nasab
f31fa4ea7e
Fenwick Tree (#6319)
* Enhance fenwick_tree.py

* Change update to add in fenwick_tree.py

* Some changes

* Fix bug

* Add O(N) initializer to FenwickTree

* Add get method to Fenwick Tree

* Change tree in Fenwick Tree

* Add rank query to FenwickTree

* Add get_array method to FenwickTree

* Add some tests

* Update data_structures/binary_tree/fenwick_tree.py

Co-authored-by: Christian Clauss <cclauss@me.com>

* Update data_structures/binary_tree/fenwick_tree.py

Co-authored-by: Christian Clauss <cclauss@me.com>

* Update data_structures/binary_tree/fenwick_tree.py

Co-authored-by: Christian Clauss <cclauss@me.com>

* change `List` to `list`

Co-authored-by: Christian Clauss <cclauss@me.com>
2022-08-16 19:38:33 +02:00
AmirMohammad Hosseini Nasab
f46ce47274
Add Max Fenwick Tree (#6298)
* Add `MaxFenwickTree`

* Reformat code style

* Fix type hints

* Fix type hints again

* Complete docstring

* Complete docstring

* Fix typo in file name

* Change MaxFenwickTree into 0-based indexing

* Fix Bugs

* Minor fix
2022-08-12 11:12:58 +02:00
Maxim Smolskiy
063a0eced9
feat: add Project Euler problem 115 solution 1 (#6303)
Co-authored-by: github-actions <${GITHUB_ACTOR}@users.noreply.github.com>
2022-08-07 16:50:45 +05:30
Maxim Smolskiy
a69d880bb5
feat: add Project Euler problem 114 solution 1 (#6300)
Co-authored-by: github-actions <${GITHUB_ACTOR}@users.noreply.github.com>
2022-08-07 07:37:35 +05:30
Horst JENS
9eac958725
typo corrected: heart -> Earth (#6275) 2022-08-06 17:47:56 +02:00
Maxim Smolskiy
defc205ef4
perf: improve Project Euler problem 203 solution 1 (#6279)
Improve solution (locally 1500+ times - from 3+ seconds to ~2 milliseconds)

Co-authored-by: github-actions <${GITHUB_ACTOR}@users.noreply.github.com>
2022-08-06 19:34:24 +05:30
Maxim Smolskiy
97f25d4b43
feat: add Project Euler problem 587 solution 1 (#6269)
Co-authored-by: github-actions <${GITHUB_ACTOR}@users.noreply.github.com>
2022-07-26 21:45:14 +05:30
Maxim Smolskiy
90959212e5
perf: improve Project Euler problem 030 solution 1 (#6267)
Improve solution (locally 3+ times - from 3+ seconds to ~1 second)

Co-authored-by: github-actions <${GITHUB_ACTOR}@users.noreply.github.com>
2022-07-25 22:11:12 +05:30
keshav Sharma
7d9ebee75f
chore: rename gcd to greatest_common_divisor (#6265)
As described in CONTRIBUTING.md

> Expand acronyms because gcd() is hard to understand but greatest_common_divisor() is not.

Co-authored-by: Dhruv Manilawala <dhruvmanila@gmail.com>
2022-07-24 21:33:10 +05:30
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