Commit Graph

2913 Commits

Author SHA1 Message Date
Kotmin
5a4ea233cd
Style sigmoid function in harmony with pep guideness (#6677)
* Style sigmoid function in harmony with pep guideness

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

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

* Apply suggestions from code review

---------

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-09-04 13:38:26 -04:00
pre-commit-ci[bot]
421ace81ed
[pre-commit.ci] pre-commit autoupdate (#9013)
* [pre-commit.ci] pre-commit autoupdate

updates:
- [github.com/astral-sh/ruff-pre-commit: v0.0.285 → v0.0.286](https://github.com/astral-sh/ruff-pre-commit/compare/v0.0.285...v0.0.286)
- [github.com/tox-dev/pyproject-fmt: 0.13.1 → 1.1.0](https://github.com/tox-dev/pyproject-fmt/compare/0.13.1...1.1.0)

* updating DIRECTORY.md

* Fis ruff rules PIE808,PLR1714

---------

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-08-29 15:18:10 +02:00
Arijit De
0a9438071e
Updated postfix_evaluation.py to support Unary operators (#8787)
* Updated postfix_evaluation.py to support Unary operators and floating point numbers Fixes #8754 and #8724

Also merged evaluate_postfix_notations.py and postfix_evaluation.py into postfix_evaluation.py

Signed-off-by: Arijit De <arijitde2050@gmail.com>

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

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

* Updated postfix_evaluation.py to support Unary operators and floating point numbers. Fixes #8754 and formatted code to pass ruff and black test.

Also merged evaluate_postfix_notations.py and postfix_evaluation.py into postfix_evaluation.py which fixes #8724 and made sure it passes doctest

Signed-off-by: Arijit De <arijitde2050@gmail.com>

* Fixed return type hinting required by pre commit for evaluate function

Signed-off-by: Arijit De <arijitde2050@gmail.com>

* Changed line 186 to return only top of stack instead of calling the get_number function as it was converting float values to int, resulting in data loss. Fixes #8754 and #8724

Signed-off-by: Arijit De <arijitde2050@gmail.com>

* Made the requested changes

Also changed the code to make the evaluate function first convert all the numbers and then process the valid expression.

* Fixes #8754, #8724 Updated postfix_evaluation.py

postfix_evaluation.py now supports Unary operators and floating point numbers.
Also merged evaluate_postfix_notations.py and postfix_evaluation.py into postfix_evaluation.py which fixes #8724. Added a doctest example with unary operator.

* Fixes #8754, #8724 Updated postfix_evaluation.py

postfix_evaluation.py now supports Unary operators and floating point numbers.
Also merged evaluate_postfix_notations.py and postfix_evaluation.py into postfix_evaluation.py which fixes #8724. Added a doctest example with unary operator.

* Fixes #8754, #8724 Updated the parse_token function of postfix_evaluation.py

ostfix_evaluation.py now supports Unary operators and floating point numbers.
Also merged evaluate_postfix_notations.py and postfix_evaluation.py into postfix_evaluation.py which fixes #8724. Added a doctest example with unary operator and invalid expression.

* Fixes #8754, #8724 Updated postfix_evaluation.py

postfix_evaluation.py now supports Unary operators and floating point numbers.
Also merged evaluate_postfix_notations.py and postfix_evaluation.py into postfix_evaluation.py which fixes #8724. Added a doctest example with unary operator and invalid expression.

* Update postfix_evaluation.py

* Update postfix_evaluation.py

* Update postfix_evaluation.py

* Update postfix_evaluation.py

* Update postfix_evaluation.py

---------

Signed-off-by: Arijit De <arijitde2050@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>
2023-08-23 14:36:59 +02:00
Caeden Perelli-Harris
fceacf977f
Fix type errors in permutations (#9007)
* updating DIRECTORY.md

* types(permuations): Rename permute2

* Apply suggestions from code review

Co-authored-by: Tianyi Zheng <tianyizheng02@gmail.com>

* fix(permutations): Call permute_recursive

* fix(permutations): Correct permutations order

---------

Co-authored-by: github-actions <${GITHUB_ACTOR}@users.noreply.github.com>
Co-authored-by: Tianyi Zheng <tianyizheng02@gmail.com>
2023-08-22 02:33:47 -07:00
pre-commit-ci[bot]
c7aeaa3fd8
[pre-commit.ci] pre-commit autoupdate (#9006)
* [pre-commit.ci] pre-commit autoupdate

updates:
- [github.com/astral-sh/ruff-pre-commit: v0.0.284 → v0.0.285](https://github.com/astral-sh/ruff-pre-commit/compare/v0.0.284...v0.0.285)
- [github.com/abravalheri/validate-pyproject: v0.13 → v0.14](https://github.com/abravalheri/validate-pyproject/compare/v0.13...v0.14)
- [github.com/pre-commit/mirrors-mypy: v1.5.0 → v1.5.1](https://github.com/pre-commit/mirrors-mypy/compare/v1.5.0...v1.5.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-08-22 07:42:14 +02:00
Caeden Perelli-Harris
04fd5c1b5e
Create langtons ant algorithm (#8967)
* updating DIRECTORY.md

* feat(cellular_automata): Langonts ant algorithm

* updating DIRECTORY.md

* Update cellular_automata/langtons_ant.py

Co-authored-by: Tianyi Zheng <tianyizheng02@gmail.com>

* Apply suggestions from code review

Co-authored-by: Tianyi Zheng <tianyizheng02@gmail.com>

* fix(langtons-ant): Set funcanimation interval to 1

---------

Co-authored-by: github-actions <${GITHUB_ACTOR}@users.noreply.github.com>
Co-authored-by: Tianyi Zheng <tianyizheng02@gmail.com>
2023-08-21 16:20:51 -07:00
AmirSoroush
b3dc6ef035
fixes #9002; improve insertion_sort algorithm (#9005)
* fixes #9002; improve insertion_sort algorithm

* add type hints to sorts/insertion_sort.py
2023-08-21 16:17:02 -07:00
Caeden Perelli-Harris
1210559deb
Consolidate decimal to binary iterative and recursive (#8999)
* updating DIRECTORY.md

* refactor(decimal-to-binary): Consolidate implementations

* updating DIRECTORY.md

* refactor(decimal-to-binary): Rename main and helper recursive

---------

Co-authored-by: github-actions <${GITHUB_ACTOR}@users.noreply.github.com>
2023-08-21 06:25:20 -07:00
Dom
1984d97171
Refactorings (#8987)
* use np.dot

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

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

* further improvements using array slicing

Co-authored-by: Tianyi Zheng <tianyizheng02@gmail.com>

---------

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-08-20 16:43:09 -07:00
Guduly
672e7bde2e
Update arc_length.py (#8964)
* Update arc_length.py

Wrote the output of testcase

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

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

* Update arc_length.py

Added the requested changes

* Update arc_length.py

followed the change request

* Update arc_length.py

followed suggestions

---------

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
2023-08-20 16:39:29 -07:00
Bama Charan Chhandogi
062957ef27
Octal to Binary Convert (#8949)
* Octal to Binary Convert

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

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

* mention return type

* code scratch

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

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

* mentioned return type

* remove comment

* added documention and some test cases

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

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

* add another test case

* fixes documention

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

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

* Documention and test cases added

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

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

* documention problem solved

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

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

* error in exit 1

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

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

* Apply suggestions from code review

---------

Co-authored-by: BamaCharanChhandogi <b.c.chhandogi@gmailcom>
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-08-20 05:40:23 -07:00
Tianyi Zheng
5ecb6baef8
Move and reimplement convert_number_to_words.py (#8998)
* Move and reimplement convert_number_to_words.py

- Move convert_number_to_words.py from web_programming/ to conversions/
- Reimplement the algorithm from scratch because the logic was very
  opaque and too heavily nested
- Add support for the Western numbering system (both short and long)
  because the original implementation only supported the Indian
  numbering system
- Add extensive doctests and error handling

* updating DIRECTORY.md

---------

Co-authored-by: github-actions <${GITHUB_ACTOR}@users.noreply.github.com>
2023-08-20 08:36:00 -04:00
Tianyi Zheng
e887c14f12
Fix continued_fraction.py to work for negative numbers (#8985)
* Add doctests to continued_fraction.py for 0 and neg nums

* Fix continued_fraction.py to work for negative nums

Fix continued_fraction.py to work for negative nums by replacing int() call with floor()

* Move comment in doctest
2023-08-18 16:53:17 -04:00
Caeden Perelli-Harris
945803f65d
Unmark fetch anime and play as BROKEN and fix type errors (#8988)
* updating DIRECTORY.md

* type(fetch-anime-and-play): Fix type errors and re-enable

* updating DIRECTORY.md

---------

Co-authored-by: github-actions <${GITHUB_ACTOR}@users.noreply.github.com>
2023-08-18 05:19:25 -07:00
Caeden Perelli-Harris
5f7819e1cd
Fix get top billionaires BROKEN file (#8970)
* updating DIRECTORY.md

* fix(get-top-billionaires): Handle timestamp before epoch

* updating DIRECTORY.md

* revert(pyproject): Re-implement ignore lru_cache

* fix(age): Update age to current year

* fix(doctest): Make years since dynamic

---------

Co-authored-by: github-actions <${GITHUB_ACTOR}@users.noreply.github.com>
2023-08-18 05:13:38 -07:00
Boris Galochkin
72c7b05caa
Fix sorts/bucket_sort.py implementation (#5786)
* Fix sorts/bucket_sort.py

* updating DIRECTORY.md

* Remove unused var in bucket_sort.py

* Fix list index in bucket_sort.py

---------

Co-authored-by: Tianyi Zheng <tianyizheng02@gmail.com>
Co-authored-by: github-actions <${GITHUB_ACTOR}@users.noreply.github.com>
2023-08-17 18:38:19 -07:00
Ilkin Mengusoglu
a207187ddb
Fix simplex.py (#8843)
* changes to accommodate special case

* changed n_slack calculation method

* fix precommit typehints

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

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

* n_art_vars inputs

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

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

* fix: docstrings and typehints

* fix: doctest issues when running code

* additional check and doctests

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

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

* fix ruff

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

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

* fix whitespace

---------

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
2023-08-17 14:34:53 -07:00
Kausthub Kannan
f6b12420ce
Added Leaky ReLU Activation Function (#8962)
* Added Leaky ReLU activation function

* Added Leaky ReLU activation function

* Added Leaky ReLU activation function

* Formatting and spelling fixes done
2023-08-16 18:22:15 -07:00
Caeden Perelli-Harris
fd7cc4cf8e
Rename norgate to nor_gate to keep consistency (#8968)
* refactor(boolean-algebra): Rename norgate to nor_gate

* updating DIRECTORY.md

---------

Co-authored-by: github-actions <${GITHUB_ACTOR}@users.noreply.github.com>
2023-08-16 18:21:00 -07:00
Tianyi Zheng
beb43517c3
Fix mypy errors in maths/gaussian_error_linear_unit.py (#8610)
* updating DIRECTORY.md

* Fix mypy errors in gaussian_error_linear_unit.py

* updating DIRECTORY.md

* updating DIRECTORY.md

---------

Co-authored-by: github-actions <${GITHUB_ACTOR}@users.noreply.github.com>
2023-08-16 07:36:10 -04:00
homsim
5c276a8377
Quick fix: fig.canvas.set_window_title deprecated (#8961)
Co-authored-by: homsim <simon@simon-ThinkPadE460.fritz.box>
2023-08-16 01:07:50 -07:00
Saksham1970
bfed2fb788
Added Continued fractions (#6846)
* updating DIRECTORY.md

* added continued fractions

* updating DIRECTORY.md

* Update maths/continued_fraction.py

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

* Update maths/continued_fraction.py

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

---------

Co-authored-by: github-actions <${GITHUB_ACTOR}@users.noreply.github.com>
Co-authored-by: Caeden Perelli-Harris <caedenperelliharris@gmail.com>
Co-authored-by: Tianyi Zheng <tianyizheng02@gmail.com>
2023-08-16 00:24:12 -07:00
Maxim Smolskiy
f66568e981
Reduce the complexity of boolean_algebra/quine_mc_cluskey.py (#8604)
* Reduce the complexity of boolean_algebra/quine_mc_cluskey.py

* updating DIRECTORY.md

* Fix

* Fix review issues

* Fix

* Fix review issues

---------

Co-authored-by: github-actions <${GITHUB_ACTOR}@users.noreply.github.com>
2023-08-15 16:10:22 -07:00
isidroas
efaf526737
BST and RSA doctest (#8693)
* rsa key doctest

* move doctest to module docstring

* all tests to doctest

* moved is_right to property

* is right test

* fixed rsa doctest import

* Test error when deleting non-existing element

* fixing ruff EM102

* convert property 'is_right' to one-liner

Also use 'is' instead of '=='

Co-authored-by: Tianyi Zheng <tianyizheng02@gmail.com>

* child instead of children

Co-authored-by: Tianyi Zheng <tianyizheng02@gmail.com>

* remove type hint

* Update data_structures/binary_tree/binary_search_tree.py

---------

Co-authored-by: Tianyi Zheng <tianyizheng02@gmail.com>
2023-08-15 16:04:53 -07:00
Juyoung Kim
cecf1fdd52
Fix greedy_best_first (#8775)
* fix: typo
#8770

* refactor: delete unnecessary continue

* add test grids

* fix: add \_\_eq\_\_ in Node class
#8770

* fix: delete unnecessary code
- node in self.open_nodes is always better node
#8770

* fix: docstring

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

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

* fix: docstring max length

* refactor: get the successors using a list comprehension

* Apply suggestions from code review

---------

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-08-15 15:52:51 -07:00
Caeden Perelli-Harris
490e645ed3
Fix minor typing errors in maths/ (#8959)
* updating DIRECTORY.md

* types(maths): Fix pylance issues in maths

* reset(vsc): Reset settings changes

* Update maths/jaccard_similarity.py

Co-authored-by: Tianyi Zheng <tianyizheng02@gmail.com>

* revert(erosion_operation): Revert erosion_operation

* test(jaccard_similarity): Add doctest to test alternative_union

* types(newton_raphson): Add typehints to func bodies

---------

Co-authored-by: github-actions <${GITHUB_ACTOR}@users.noreply.github.com>
Co-authored-by: Tianyi Zheng <tianyizheng02@gmail.com>
2023-08-15 14:27:41 -07:00
Erfan Alimohammadi
7618a92fee
Remove a slash in path to save the file correctly on Linux (#8053) 2023-08-15 16:37:49 -04:00
pre-commit-ci[bot]
7021afda04
[pre-commit.ci] pre-commit autoupdate (#8963)
updates:
- [github.com/astral-sh/ruff-pre-commit: v0.0.282 → v0.0.284](https://github.com/astral-sh/ruff-pre-commit/compare/v0.0.282...v0.0.284)
- [github.com/tox-dev/pyproject-fmt: 0.13.0 → 0.13.1](https://github.com/tox-dev/pyproject-fmt/compare/0.13.0...0.13.1)
- [github.com/pre-commit/mirrors-mypy: v1.4.1 → v1.5.0](https://github.com/pre-commit/mirrors-mypy/compare/v1.4.1...v1.5.0)

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
2023-08-14 23:12:11 -04:00
Caeden Perelli-Harris
fb1b939a89
Consolidate find_min and find_min recursive and find_max and find_max_recursive (#8960)
* updating DIRECTORY.md

* refactor(min-max): Consolidate implementations

* updating DIRECTORY.md

* refactor(min-max): Append _iterative to func name

---------

Co-authored-by: github-actions <${GITHUB_ACTOR}@users.noreply.github.com>
2023-08-14 04:17:27 -07:00
robertjcalistri
2ab3bf2689
Added functions to calculate temperature of an ideal gas and number o… (#8919)
* Added functions to calculate temperature of an ideal gas and number of moles of an ideal gas

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

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

* Update physics/ideal_gas_law.py

Renamed function name

Co-authored-by: Tianyi Zheng <tianyizheng02@gmail.com>

* Update physics/ideal_gas_law.py

Updated formatting

Co-authored-by: Tianyi Zheng <tianyizheng02@gmail.com>

* Update physics/ideal_gas_law.py

Removed unnecessary parentheses

Co-authored-by: Tianyi Zheng <tianyizheng02@gmail.com>

* Update physics/ideal_gas_law.py

Removed unnecessary parentheses

Co-authored-by: Tianyi Zheng <tianyizheng02@gmail.com>

* Update ideal_gas_law.py

Updated incorrect function calls moles of gas system doctests

* Update physics/ideal_gas_law.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-08-14 02:31:53 -07:00
Adithya Awati
ac68dc1128
Fixed Pytest warnings for machine_learning/forecasting (#8958)
* updating DIRECTORY.md

* Fixed pyTest Warnings

---------

Co-authored-by: github-actions <${GITHUB_ACTOR}@users.noreply.github.com>
2023-08-14 01:34:16 -07:00
Caeden Perelli-Harris
4b7ecb6a81
Create is valid email address algorithm (#8907)
* feat(strings): Create is valid email address

* updating DIRECTORY.md

* feat(strings): Create is_valid_email_address algorithm

* chore(is_valid_email_address): Implement changes from code review

* Update strings/is_valid_email_address.py

Co-authored-by: Tianyi Zheng <tianyizheng02@gmail.com>

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

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

* chore(is_valid_email_address): Fix ruff error

* Update strings/is_valid_email_address.py

Co-authored-by: Tianyi Zheng <tianyizheng02@gmail.com>

---------

Co-authored-by: github-actions <${GITHUB_ACTOR}@users.noreply.github.com>
Co-authored-by: Tianyi Zheng <tianyizheng02@gmail.com>
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
2023-08-14 01:28:52 -07:00
Adithya Awati
c290dd6a43
Update run.py in machine_learning/forecasting (#8957)
* Fixed reading CSV file, added type check for data_safety_checker function

* Formatted run.py

* updating DIRECTORY.md

---------

Co-authored-by: github-actions <${GITHUB_ACTOR}@users.noreply.github.com>
2023-08-14 00:16:24 -07:00
Ajinkya Chikhale
02d89bde67
Added implementation for Tribonacci sequence using dp (#6356)
* Added implementation for Tribonacci sequence using dp

* Updated parameter name

* Apply suggestions from code review

---------

Co-authored-by: Tianyi Zheng <tianyizheng02@gmail.com>
2023-08-14 00:12:42 -07:00
Amir Hosseini
f24ab2c60d
Add: Two Regex match algorithm (Recursive & DP) (#6321)
* Add recursive solution to regex_match.py

* Add dp solution to regex_match.py

* Add link to regex_match.py

* Minor edit

* Minor change

* Minor change

* Update dynamic_programming/regex_match.py

Co-authored-by: Tianyi Zheng <tianyizheng02@gmail.com>

* Update dynamic_programming/regex_match.py

Co-authored-by: Tianyi Zheng <tianyizheng02@gmail.com>

* Fix ruff formatting in if statements

* Update dynamic_programming/regex_match.py

Co-authored-by: Tianyi Zheng <tianyizheng02@gmail.com>

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

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

---------

Co-authored-by: Tianyi Zheng <tianyizheng02@gmail.com>
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
2023-08-13 22:37:41 -07:00
Caeden Perelli-Harris
9d86d4edaa
Create wa-tor algorithm (#8899)
* feat(cellular_automata): Create wa-tor algorithm

* updating DIRECTORY.md

* chore(quality): Implement algo-keeper bot changes

* Update cellular_automata/wa_tor.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

* refactor(repr): Return repr as python object

* Update cellular_automata/wa_tor.py

Co-authored-by: Tianyi Zheng <tianyizheng02@gmail.com>

* Update cellular_automata/wa_tor.py

Co-authored-by: Tianyi Zheng <tianyizheng02@gmail.com>

* Update cellular_automata/wa_tor.py

Co-authored-by: Tianyi Zheng <tianyizheng02@gmail.com>

* Update cellular_automata/wa_tor.py

Co-authored-by: Tianyi Zheng <tianyizheng02@gmail.com>

* Update cellular_automata/wa_tor.py

Co-authored-by: Tianyi Zheng <tianyizheng02@gmail.com>

* Update cellular_automata/wa_tor.py

Co-authored-by: Tianyi Zheng <tianyizheng02@gmail.com>

* Update cellular_automata/wa_tor.py

Co-authored-by: Tianyi Zheng <tianyizheng02@gmail.com>

* Update cellular_automata/wa_tor.py

Co-authored-by: Tianyi Zheng <tianyizheng02@gmail.com>

* Update cellular_automata/wa_tor.py

Co-authored-by: Tianyi Zheng <tianyizheng02@gmail.com>

* Update cellular_automata/wa_tor.py

Co-authored-by: Tianyi Zheng <tianyizheng02@gmail.com>

* Update cellular_automata/wa_tor.py

Co-authored-by: Tianyi Zheng <tianyizheng02@gmail.com>

* refactor(display): Rename to display_visually to visualise

* refactor(wa-tor): Use double for loop

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

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

* chore(wa-tor): Implement suggestions from code review

---------

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>
Co-authored-by: Tianyi Zheng <tianyizheng02@gmail.com>
2023-08-13 17:58:17 -07:00
Maxim Smolskiy
4f2a346c27
Reduce the complexity of linear_algebra/src/polynom_for_points.py (#8605)
* Reduce the complexity of linear_algebra/src/polynom_for_points.py

* updating DIRECTORY.md

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

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

* Fix

* Fix review issues

---------

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>
2023-08-13 03:05:42 -07:00
Suman
c39b7eadbd
updated the URL and HTML tags for scrapping yahoo finance (#8942)
* updated the url and tags for yahoo finance

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

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

* updated to return the error text

---------

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
2023-08-12 14:58:37 -07:00
Tianyi Zheng
ae0fc85401
Fix ruff errors (#8936)
* Fix ruff errors

Renamed neural_network/input_data.py to neural_network/input_data.py_tf
because it should be left out of the directory for the following
reasons:

1. Its sole purpose is to be used by neural_network/gan.py_tf, which is
   itself left out of the directory because of issues with TensorFlow.

2. It was taken directly from TensorFlow's codebase and is actually
   already deprecated. If/when neural_network/gan.py_tf is eventually
   re-added back to the directory, its implementation should be changed
   to not use neural_network/input_data.py anyway.

* updating DIRECTORY.md

* Change input_data.py_tf file extension

Change input_data.py_tf file extension because algorithms-keeper bot is being picky about it

---------

Co-authored-by: github-actions <${GITHUB_ACTOR}@users.noreply.github.com>
2023-08-09 13:25:30 +05:30
AmirSoroush
842d03fb2a
improvements to jump_search.py (#8932)
* improvements to jump_search.py

* add more tests to jump_search.py
2023-08-08 14:47:09 -07:00
pre-commit-ci[bot]
ac62cdb94f
[pre-commit.ci] pre-commit autoupdate (#8930)
* [pre-commit.ci] pre-commit autoupdate

updates:
- [github.com/astral-sh/ruff-pre-commit: v0.0.281 → v0.0.282](https://github.com/astral-sh/ruff-pre-commit/compare/v0.0.281...v0.0.282)

* 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-08-07 19:52:39 -04:00
Dipankar Mitra
db6bd4b17f
IQR function is added (#8851)
* tanh function been added

* tanh function been added

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

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

* tanh function is added

* tanh function is added

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

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

* tanh function added

* tanh function added

* tanh function is added

* Apply suggestions from code review

* ELU activation function is added

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

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

* elu activation is added

* ELU activation is added

* Update maths/elu_activation.py

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

* Exponential_linear_unit activation is added

* Exponential_linear_unit activation is added

* SiLU activation is added

* SiLU activation is added

* mish added

* mish activation is added

* inter_quartile_range function is added

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

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

* Mish activation function is added

* Mish action is added

* mish activation added

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

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

* mish activation added

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

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

* inter quartile range (IQR) function is added

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

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

* IQR function is added

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

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

* code optimized in IQR function

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

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

* interquartile_range function is added

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

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

* Update maths/interquartile_range.py

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

* Changes on interquartile_range

* numpy removed from interquartile_range

* Fixes from code review

* Update interquartile_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-08-07 07:47:42 -04:00
AmirSoroush
ce218c57f1
fixes #8673; Add operator's associativity check for stacks/infix_to_p… (#8674)
* fixes #8673; Add operator's associativity check for stacks/infix_to_postfix_conversion.py

* fix ruff N806 in stacks/infix_to_postfix_conversion.py

* Update data_structures/stacks/infix_to_postfix_conversion.py

Co-authored-by: Tianyi Zheng <tianyizheng02@gmail.com>

* Update data_structures/stacks/infix_to_postfix_conversion.py

Co-authored-by: Tianyi Zheng <tianyizheng02@gmail.com>

---------

Co-authored-by: Tianyi Zheng <tianyizheng02@gmail.com>
2023-08-01 11:23:34 -07:00
pre-commit-ci[bot]
c9a7234a95
[pre-commit.ci] pre-commit autoupdate (#8914)
updates:
- [github.com/astral-sh/ruff-pre-commit: v0.0.280 → v0.0.281](https://github.com/astral-sh/ruff-pre-commit/compare/v0.0.280...v0.0.281)

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
2023-08-01 09:26:23 +05:30
Jan Wojciechowski
f7c5e55609
Window closing fix (#8625)
* The window will now remain open after the fractal is finished being drawn, and will only close upon your click.

* Update fractals/sierpinski_triangle.py

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

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

---------

Co-authored-by: Tianyi Zheng <tianyizheng02@gmail.com>
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
2023-07-31 20:02:49 -07:00
Minha, Jeong
f8fe72dc37
Update game_of_life.py (#4921)
* Update game_of_life.py

docstring error fix
delete no reason delete next_gen_canvas code(local variable)

* Update cellular_automata/game_of_life.py

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

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

---------

Co-authored-by: Tianyi Zheng <tianyizheng02@gmail.com>
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
2023-07-31 14:24:12 -07:00
Tianyi Zheng
5cf34d901e
Ruff fixes (#8913)
* updating DIRECTORY.md

* Fix ruff error in eulerian_path_and_circuit_for_undirected_graph.py

* Fix ruff error in newtons_second_law_of_motion.py

---------

Co-authored-by: github-actions <${GITHUB_ACTOR}@users.noreply.github.com>
2023-07-31 13:53:26 -07:00
Dylan Buchi
90a8e6e0d2
Update sorts/bubble_sort.py (#5802)
* Add missing type annotations in bubble_sort.py

* Refactor bubble_sort function
2023-07-31 11:50:00 -07:00
roger-sato
0b0214c42f
Handle empty input case in Segment Tree build process (#8718) 2023-07-31 11:46:30 -07:00
Tianyi Zheng
629eb86ce0
Fix merge conflicts to merge change from #5080 (#8911)
* Input for user choose his Collatz sequence

Now the user can tell the algorithm what number he wants to run on the Collatz Sequence.

* updating DIRECTORY.md

---------

Co-authored-by: Hugo Folloni <hugofollogua07@gmail.com>
Co-authored-by: github-actions <${GITHUB_ACTOR}@users.noreply.github.com>
2023-07-31 07:23:23 +02:00