Commit Graph

3384 Commits

Author SHA1 Message Date
Param Thakkar
51c5c87b9a
File moved to neural_network/activation_functions (#11216)
* added GELU activation functions file

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

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

* Update gaussian_error_linear_unit.py

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

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

* Update gaussian_error_linear_unit.py

* Delete neural_network/activation_functions/gaussian_error_linear_unit.py

* Rename maths/gaussian_error_linear_unit.py to neural_network/activation_functions/gaussian_error_linear_unit.py

---------

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
2023-12-27 03:35:29 -05:00
pre-commit-ci[bot]
94c8e1ab73
[pre-commit.ci] pre-commit autoupdate (#11223)
updates:
- [github.com/astral-sh/ruff-pre-commit: v0.1.8 → v0.1.9](https://github.com/astral-sh/ruff-pre-commit/compare/v0.1.8...v0.1.9)
- [github.com/psf/black: 23.12.0 → 23.12.1](https://github.com/psf/black/compare/23.12.0...23.12.1)
- [github.com/pre-commit/mirrors-mypy: v1.7.1 → v1.8.0](https://github.com/pre-commit/mirrors-mypy/compare/v1.7.1...v1.8.0)

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
2023-12-25 19:24:39 +01:00
Tushar Pamnani
7b9f82cc44
optimize quicksort implementation (#11196)
* optimize quicksort implementation

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

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

* Apply suggestions from code review

* Update quick_sort.py

---------

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: Tianyi Zheng <tianyizheng02@gmail.com>
2023-12-19 20:59:51 -05:00
Indrajeet Mishra
b46fc1de04
Corrected the Python Doctest command in equilibrium_index_in_array.py script (#11212)
Co-authored-by: Indrajeet Mishra <indrajeetmishra@thecoddiwompler.local>
2023-12-20 00:05:27 +01:00
pre-commit-ci[bot]
2d0ed135a0
[pre-commit.ci] pre-commit autoupdate (#11215)
updates:
- [github.com/astral-sh/ruff-pre-commit: v0.1.7 → v0.1.8](https://github.com/astral-sh/ruff-pre-commit/compare/v0.1.7...v0.1.8)
- [github.com/psf/black: 23.11.0 → 23.12.0](https://github.com/psf/black/compare/23.11.0...23.12.0)

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
2023-12-18 21:17:46 +01:00
pre-commit-ci[bot]
c14a580c9e
[pre-commit.ci] pre-commit autoupdate (#11210)
updates:
- [github.com/astral-sh/ruff-pre-commit: v0.1.6 → v0.1.7](https://github.com/astral-sh/ruff-pre-commit/compare/v0.1.6...v0.1.7)

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
2023-12-11 19:27:15 +01:00
pre-commit-ci[bot]
a73f37b2ec
[pre-commit.ci] pre-commit autoupdate (#11195)
* [pre-commit.ci] pre-commit autoupdate

updates:
- [github.com/tox-dev/pyproject-fmt: 1.5.1 → 1.5.3](https://github.com/tox-dev/pyproject-fmt/compare/1.5.1...1.5.3)

* 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>
2023-12-04 20:00:34 +01:00
Pedram_Mohajer
82e539dc82
Create smallestRange.py (#11179)
* Create smallestRange.py

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

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

* Update smallestRange.py

* Update smallestRange.py

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

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

* Update smallestRange.py

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

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

* Update and rename smallestRange.py to smallestrange.py

* Update smallestrange.py

* Update smallestrange.py

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

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

* Update smallestrange.py

* Rename smallestrange.py to smallest_range.py

* Update smallest_range.py

* Update smallest_range.py

* Update smallest_range.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>
2023-12-01 17:53:47 +01:00
pre-commit-ci[bot]
0ac97f359f
[pre-commit.ci] pre-commit autoupdate (#11184)
* [pre-commit.ci] pre-commit autoupdate

updates:
- [github.com/pre-commit/mirrors-mypy: v1.7.0 → v1.7.1](https://github.com/pre-commit/mirrors-mypy/compare/v1.7.0...v1.7.1)

* 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>
2023-11-27 19:13:24 +01:00
Pedram_Mohajer
b860003576
Add doctest to is_safe function (#11183) 2023-11-27 18:43:51 +01:00
Pedram_Mohajer
154e5e8681
Update levenshtein_distance.py (#11171)
* Update levenshtein_distance.py

* Update levenshtein_distance.py

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

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

* Update levenshtein_distance.py

* Update levenshtein_distance.py

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

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

* Update levenshtein_distance.py

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

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

* Update levenshtein_distance.py

* Update levenshtein_distance.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>
Co-authored-by: Christian Clauss <cclauss@me.com>
2023-11-26 23:46:54 +01:00
Suyash Dongre
84a1533fd5
Added doctest to binary_search_tree.py (#11145)
* Added doctest to binary_search_tree.py

* Apply suggestions from code review

---------

Co-authored-by: Christian Clauss <cclauss@me.com>
2023-11-25 15:29:44 +01:00
Harsh Kumar
86ae30d29e
Create Spearman's rank correlation coefficient (#11155)
* Create spearman_rank_correlation_coefficient.py

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

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

* Fixed Issues

* Added More Description

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

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

* Fixed Issues

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

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

* Tried Fixing Issues

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

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

* Tried Fixing Issues

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

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

* Fixed Issues

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

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

* Fixed Issues

* Apply suggestions from code review

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

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

* Update maths/spearman_rank_correlation_coefficient.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>
2023-11-25 15:20:42 +01:00
pre-commit-ci[bot]
8b39a0fb54
[pre-commit.ci] pre-commit autoupdate (#11154)
* [pre-commit.ci] pre-commit autoupdate

updates:
- [github.com/astral-sh/ruff-pre-commit: v0.1.4 → v0.1.6](https://github.com/astral-sh/ruff-pre-commit/compare/v0.1.4...v0.1.6)
- [github.com/psf/black: 23.10.1 → 23.11.0](https://github.com/psf/black/compare/23.10.1...23.11.0)
- [github.com/tox-dev/pyproject-fmt: 1.4.1 → 1.5.1](https://github.com/tox-dev/pyproject-fmt/compare/1.4.1...1.5.1)
- [github.com/pre-commit/mirrors-mypy: v1.6.1 → v1.7.0](https://github.com/pre-commit/mirrors-mypy/compare/v1.6.1...v1.7.0)

* updating DIRECTORY.md

* Update spiral_print.py

* Update matrix/spiral_print.py

* Update matrix/spiral_print.py

---------

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>
Co-authored-by: Christian Clauss <cclauss@me.com>
2023-11-25 14:53:18 +01:00
moaldeen
050b2a6e2c
Bug fix combinations (#11158)
* Update all_combinations.py

The original implementation had limitations in handling edge cases and certain input parameters, leading to potential RecursionError.

* Update all_combinations.py

Added checks to handle cases where n or k are negative or where k is greater than n. In such scenarios, the function now returns an empty list, avoiding invalid recursive calls.

* Update error handling

Added checks to handle cases where `n` or `k` are negative or where `k` is greater than `n`. In such scenarios, the function now returns an empty list, avoiding invalid recursive calls.

* Update backtracking/all_combinations.py

* Update all_combinations.py

---------

Co-authored-by: Christian Clauss <cclauss@me.com>
2023-11-25 14:31:17 +01:00
Clark
4151a13b57
add graphs/ant_colony_optimization_algorithms.py (#11163)
* add ant_colonyant_colony_optimization_algorithms.py

* Modify details

* Modify type annotation

* Add tests for KeyError, IndexError, StopIteration, etc.

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

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

---------

Co-authored-by: Christian Clauss <cclauss@me.com>
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
2023-11-25 13:26:03 +01:00
Rahid Zeynalov
5898b9603b
Typo deicmal -> decimal (#11169) 2023-11-25 12:25:46 +01:00
MC
b8e7a4c76c
Fix typo in knight_tour.py (#11173) 2023-11-25 12:17:59 +01:00
Margaret
3999abfea3
adding a geometry module (#11138)
* adding a geometry module

* fixing errors and adding type hints

* Create code_review_feedback.py

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

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

* implementing suggestions

* fixing ruff errors

* Update geometry/code_review_feedback.py

* Update geometry/code_review_feedback.py

* Update geometry/geometry.py

* Apply suggestions from code review

* Delete geometry/code_review_feedback.py

* Update geometry/geometry.py

* Update geometry/geometry.py

---------

Co-authored-by: Christian Clauss <cclauss@me.com>
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
2023-11-24 19:00:21 +01:00
MC
5f61af4fbb
Fix ignore venv in build_directory_md.py (#11156)
Co-authored-by: MICHAEL CASTLE <CASTLM@tdm.local>
2023-11-16 17:00:48 +06:00
Suyash Dongre
0e2e6abd6f
Added doctest to heap.py (#11129)
* Added doctest to heap.py

* Update heap.py
2023-11-13 17:05:22 +06:00
Suyash Dongre
fb17eeab7d
Added doctest to stack.py (#11149) 2023-11-11 21:16:43 -05:00
Suyash Dongre
8b7352626e
Added doctest to randomized_heap.py (#11151) 2023-11-11 21:13:04 -05:00
pre-commit-ci[bot]
a13e9c2137
[pre-commit.ci] pre-commit autoupdate (#11146)
* [pre-commit.ci] pre-commit autoupdate

updates:
- [github.com/astral-sh/ruff-pre-commit: v0.1.3 → v0.1.4](https://github.com/astral-sh/ruff-pre-commit/compare/v0.1.3...v0.1.4)
- [github.com/tox-dev/pyproject-fmt: 1.3.0 → 1.4.1](https://github.com/tox-dev/pyproject-fmt/compare/1.3.0...1.4.1)

* updating DIRECTORY.md

* [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>
Co-authored-by: github-actions <${GITHUB_ACTOR}@users.noreply.github.com>
2023-11-07 06:49:09 +06:00
Suyash Dongre
12e401650c
Added doctest to string_switch_case.py (#11136)
* Added doctest to string_switch_case.py

* Update string_switch_case.py
2023-11-06 18:18:41 +06:00
Suyash Dongre
fa508d7b8b
Added doctest to detecting_english_programmatically.py (#11135) 2023-11-06 18:14:39 +06:00
Sunny Kumar
eb989c08cd
Data structures/arrays/triplet sum (#11134)
* updated code for find triplets with 0 sum

Signed-off-by: Skyad <777.sunnykumar@gmail.com>

* extra line added at the end of file

Signed-off-by: Sunny Kumar <sunny.kumar09@ad.infosys.com>

* extra line added at the end of file

Signed-off-by: Skyad <777.sunnykumar@gmail.com>

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

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

* file updated with comments

Signed-off-by: Skyad <777.sunnykumar@gmail.com>

* updated the comments as suggested by community

Signed-off-by: Sunny Kumar <sunny.kumar09@ad.infosys.com>

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

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

* file updated according to community comments

Signed-off-by: Skyad <777.sunnykumar@gmail.com>

* Update find_triplets_with_0_sum.py

---------

Signed-off-by: Skyad <777.sunnykumar@gmail.com>
Signed-off-by: Sunny Kumar <sunny.kumar09@ad.infosys.com>
Co-authored-by: Sunny Kumar <sunny.kumar09@ad.infosys.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>
2023-11-06 18:10:50 +06:00
SEIKH NABAB UDDIN
e48ea7d396
Create get_ip_geolocation.py (#10902)
* Create get_ip_geolocation.py

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

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

* Update get_ip_geolocation.py

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

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

* Update get_ip_geolocation.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>
2023-11-05 14:28:52 +05:45
Suyash Dongre
1e50cf3660
Added doctest to binary_search_tree.py (#11141)
* Added doctest to binary_search_tree.py

* Update binary_search_tree.py

* Update binary_search_tree.py

---------

Co-authored-by: Christian Clauss <cclauss@me.com>
2023-11-05 14:23:39 +05:45
Suyash Dongre
257cfbdf6e
Added doctest to decision_tree.py (#11143)
* Added doctest to decision_tree.py

* Update decision_tree.py

* Update machine_learning/decision_tree.py

* Update machine_learning/decision_tree.py

* raise ValueError()

* Update decision_tree.py

---------

Co-authored-by: Christian Clauss <cclauss@me.com>
2023-11-05 14:01:00 +05:45
Suyash Dongre
ebfdb127e7
Added doctest to hash_map.py (#11105)
* Added doctest to heap.py

* Added doctest to hash_map.py

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

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

* Update hash_map.py

* Added doctest to hash_map.py

* Added doctest to hash_map.py

* Added doctest to detecting_english_programmatically.py

* Update detecting_english_programmatically.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>
2023-11-04 17:49:57 +05:45
Arya Hariharan
99f3a0e4c9
adding-docstrings (#11114)
* adding-docstrings

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

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

* Update intro_sort.py

* Update intro_sort.py

* Remove blank lines

---------

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: Christian Clauss <cclauss@me.com>
2023-10-31 07:53:38 +01:00
Akshar Goyal
b072ba657f
Added tests for validate_sudoku_board.py (#11108) 2023-10-31 01:00:48 +01:00
pre-commit-ci[bot]
79a327fc07
[pre-commit.ci] pre-commit autoupdate (#11106)
* [pre-commit.ci] pre-commit autoupdate

updates:
- [github.com/astral-sh/ruff-pre-commit: v0.1.1 → v0.1.3](https://github.com/astral-sh/ruff-pre-commit/compare/v0.1.1...v0.1.3)
- [github.com/psf/black: 23.10.0 → 23.10.1](https://github.com/psf/black/compare/23.10.0...23.10.1)
- [github.com/tox-dev/pyproject-fmt: 1.2.0 → 1.3.0](https://github.com/tox-dev/pyproject-fmt/compare/1.2.0...1.3.0)

* 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>
2023-10-30 19:17:00 +01:00
Devashri Deulkar
ddd4023fe6
Happy number (new algorithm) (#10864)
* Happy number (new algorithm)

adding new algorithm

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

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

* Update maths/special_numbers/happy_number.py

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

* Update happy_number.py

added new changes

* Update happy_number.py

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

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

* Update happy_number.py

* Update happy_number.py

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

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

* Update happy_number.py

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

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

* Update happy_number.py

added ValueError part in code

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

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

* Update happy_number.py

modified and added raise Error code

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

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

* Update happy_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>
2023-10-30 19:15:49 +01:00
Mohammad Esfandiyar
ad9948d5d4
implementation of Gaussian Elimination pivoting as a numerical linear algebra algorithm (#10457)
* Adding new implementation

Adding my python implementation of Gaussian Elimination pivoting as a numerical linear algebra algorithm

* Delete linear_algebra/src/GaussianEliminationpivoting.py

* Adding new implementation

Adding my python implementation of Gaussian Elimination pivoting as a numerical linear algebra algorithm

* Delete linear_algebra/src/gaussianeliminationpivoting.py

* Adding new implementation

Adding my python implementation of Gaussian Elimination pivoting as a numerical linear algebra algorithm 
for the third time because the last two times had conflict with the rules in PR

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

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

* Delete linear_algebra/src/gaussianeliminationpivoting.py

* Adding gaussianeliminationpivoting.py

Adding my python implementation of Gaussian Elimination pivoting as a numerical linear algebra algorithm 
for the fourth time because the last three times had conflict with the rules in PR and bots

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

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

* Update gaussianeliminationpivoting.py

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

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

* Update gaussianeliminationpivoting.py

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

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

* Update gaussianeliminationpivoting.py

I changed a to matrix and coeff_matrix for better clarity

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

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

* Update gaussianeliminationpivoting.py

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

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

* Update gaussianeliminationpivoting.py

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

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

* Update gaussianeliminationpivoting.py

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

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

* Update and rename gaussianeliminationpivoting.py to gaussian_elimination_pivoting.py

renamed the file

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

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

* Update gaussian_elimination_pivoting.py

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

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

* Update gaussian_elimination_pivoting.py

* Update gaussian_elimination_pivoting.py

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

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

* Update gaussian_elimination_pivoting.py

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

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

* Update gaussian_elimination_pivoting.py

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

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

* Update gaussian_elimination_pivoting.py

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

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

* Update gaussian_elimination_pivoting.py

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

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

* Update gaussian_elimination_pivoting.py

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

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

* Update gaussian_elimination_pivoting.py

* Update gaussian_elimination_pivoting.py

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

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

* Update gaussian_elimination_pivoting.py

* Update gaussian_elimination_pivoting.py

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

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

* Update gaussian_elimination_pivoting.py

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

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

* Update gaussian_elimination_pivoting.py

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

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

* Update gaussian_elimination_pivoting.py

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

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

* Update gaussian_elimination_pivoting.py

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

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

* Update gaussian_elimination_pivoting.py

* Update gaussian_elimination_pivoting.py

* Update gaussian_elimination_pivoting.py

* Update gaussian_elimination_pivoting.py

* Delete linear_algebra/src/gaussian_elimination_pivoting.py

* Add files via upload

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

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

* Update gaussian_elimination_pivoting.py

* Update gaussian_elimination_pivoting.py

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

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

* Delete linear_algebra/src/gaussian_elimination_pivoting/text.py

* Add files via upload

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

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

* Update linear_algebra/src/gaussian_elimination_pivoting/gaussian_elimination_pivoting.py

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

* Update gaussian_elimination_pivoting.py

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

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

* Update gaussian_elimination_pivoting.py

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

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

* Update gaussian_elimination_pivoting.py

* Update gaussian_elimination_pivoting.py

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

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

* Update gaussian_elimination_pivoting.py

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

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

* Update gaussian_elimination_pivoting.py

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

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

* Update gaussian_elimination_pivoting.py

* Update gaussian_elimination_pivoting.py

* Update gaussian_elimination_pivoting.py

* Update gaussian_elimination_pivoting.py

* Update gaussian_elimination_pivoting.py

* Update gaussian_elimination_pivoting.py

* Update gaussian_elimination_pivoting.py

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

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

* Update gaussian_elimination_pivoting.py

* Update gaussian_elimination_pivoting.py

* Update gaussian_elimination_pivoting.py

* Update gaussian_elimination_pivoting.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>
Co-authored-by: Christian Clauss <cclauss@me.com>
2023-10-30 14:20:47 +01:00
dekomori_sanae09
c38b222212
serialize deserialize binary tree (#9625)
* added serialize and desrialize bin tree

* format files

* added type hints

* added type hints

* Use dataclass .__eq__(), .__iter__(), and .__repr__()

---------

Co-authored-by: Christian Clauss <cclauss@me.com>
2023-10-30 00:07:21 +01:00
Abílio Azevedo
2531f8e221
test: adding more tests to missing number algorithm (#10394)
* test: adding more tests to missing number algorithm

* Update missing_number.py

---------

Co-authored-by: Christian Clauss <cclauss@me.com>
2023-10-29 22:43:32 +01:00
chien liu
13e66c18d2
Fix typo power_using_recursion.py (#11083) 2023-10-29 22:22:19 +01:00
Khushi Shukla
c7a1331b34
Create karnaugh_map_simplification.py (#11056)
* Create karnaugh_map_simplification.py

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

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

* Update karnaugh_map_simplification.py

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

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

* Update karnaugh_map_simplification.py

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

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

* Update karnaugh_map_simplification.py

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

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

* Update karnaugh_map_simplification.py

* Update boolean_algebra/karnaugh_map_simplification.py

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

* Update karnaugh_map_simplification.py

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

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

* Update karnaugh_map_simplification.py

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

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

* Update karnaugh_map_simplification.py

* Update karnaugh_map_simplification.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>
2023-10-29 22:20:57 +01:00
Aryansh B
760d9bedc1
Added Fast Inverse Square Root (#11054)
* Feat: Added Fast inverse square root

* Fix: Added typehint

* Fix: Added doctests that break the code, changed var name

* updating DIRECTORY.md

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

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

* Fix: fixed length of docstring

* Update fast_inverse_sqrt.py

---------

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>
Co-authored-by: Christian Clauss <cclauss@me.com>
2023-10-29 21:57:37 +01:00
dahhou ilyas
eafdb8b866
Dahhou ilyas (#10058)
* add new programme in dynamique programming wildcard_matching

* add new programme in dynamique programming wildcard_matching

* fix bug

* fix

* fix

* fix

* fix

* fix

* fix error recrusion

* fix error recrusion

* bug fix

* add doctest

* The power of enumerate()

---------

Co-authored-by: Christian Clauss <cclauss@me.com>
2023-10-29 18:24:37 +01:00
Aqib Javid Bhat
be60f42a5f
Add Josephus Problem (#10928)
* Add Josephus Problem

* Add iterative implementation of Josephus Problem

* Add descriptive variable names

* Update maths/josephus_problem.py

* Update josephus_problem.py

---------

Co-authored-by: Christian Clauss <cclauss@me.com>
2023-10-29 17:42:41 +01:00
Suyash Dongre
67c85ee289
Added doctest to hash_map.py (#11082)
* Added doctest to heap.py

* Added doctest to hash_map.py

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

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

* Update hash_map.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>
2023-10-29 17:01:54 +01:00
dragon
3ad90cea83
add a yield method to fibonaci (#10826)
* add a yiled method to fibonaci

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

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

* fibonaci

* Update fibonacci.py

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

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

* Update fibonacci.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>
2023-10-29 16:40:01 +01:00
Arshdeep Singh Sachdeva
d59cf1734f
Add running key cipher (#10834)
* Add running key cipher

* update running key cipher add doctests and hints

* Add test case

* Update return value

* range(len()) is almost always a hint to use enumerate()

---------

Co-authored-by: Christian Clauss <cclauss@me.com>
2023-10-29 15:55:37 +01:00
Kento
6b588e4d44
Added doctests for fibonacci.py (#10836)
* added other possible cases

* added test for correct output of truth table

* few fibonacci tests added

* updating DIRECTORY.md

* Update nor_gate.py

* updating DIRECTORY.md

* Update fibonacci.py

removed whitespace

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

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

---------

Co-authored-by: = <=>
Co-authored-by: github-actions <${GITHUB_ACTOR}@users.noreply.github.com>
Co-authored-by: Christian Clauss <cclauss@me.com>
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
2023-10-29 13:57:40 +01:00
Farzad Hayat
7c1dfec086
XOR Cipher: doctests and bug fixes (#10840)
* Fixed bug with key modulus wrapping. Should be wrapping on 256, not 255.

* Fixed bug with incorrect assertion type in decrypt function.

* Added doctests for 4 out of 6 methods
2023-10-29 13:57:04 +01:00
aayushsoni4
cc22d0b0ba
Generate parentheses (#10903)
* Add: Matrix Prefix Sum

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

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

* Changes made in Matrix Prefix Sum

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

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

* Changes made in Matrix Prefix Sum

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

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

* Changes made in Matrix Prefix Sum

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

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

* Changes made in Matrix Prefix Sum

* Changes made in Matrix Prefix Sum

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

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

* Changes made in Matrix Prefix Sum

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

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

* Changes made in Matrix Prefix Sum

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

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

* Changes made in Matrix Prefix Sum

* Changes made in Matrix Prefix Sum

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

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

* Changes made in Matrix Prefix Sum

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

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

* Changes made in Matrix Prefix Sum

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

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

* Changes made in Matrix Prefix Sum

* Changes made in Matrix Prefix Sum

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

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

* Changes made in Matrix Prefix Sum

* Changes made in Matrix Prefix Sum

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

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

* Changes made in Matrix Prefix Sum

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

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

* Changes made in Matrix Prefix Sum

* Add: Distinct Subsequences

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

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

* Changes made in Distinct Subsequences

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

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

* Changes made in Distinct Subsequences

* Changes made in Distinct Subsequences

* Changes made in Distinct Subsequences

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

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

* Removed Distinct Subsequences

* Add: Generate Parentheses

* Add: Generate Parentheses

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

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

* Add: Generate Parentheses

* Add: Generate Parentheses

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

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

* Add: Generate Parentheses

* Add: Generate Parentheses

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

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

* Update backtracking/generate_parentheses.py

* Delete matrix/matrix_prefix_sum.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>
2023-10-29 13:55:31 +01:00
Aqib Javid Bhat
403d3b8a29
Add Integer Square Root Algorithm (#10949)
* Add Integer Square Root Algorithm

* Update integer_square_root.py

* Update integer_square_root.py

---------

Co-authored-by: Christian Clauss <cclauss@me.com>
2023-10-29 11:58:28 +01:00