Commit Graph

3412 Commits

Author SHA1 Message Date
TechFreak107
fecbf59436
Modified 'pascal_triangle.py' program (#7901)
* Added pascals_triangle.py program to maths directory

* Deleted 'pascals_triangle.py' because of duplication. Added a optimized function to generate pascal's triangle to 'pascal_triangle.py' program. Added some aadditional doctests to the existing function. Added some type check functionality to the existing function.

* Modified type check hints in 'generate_pascal_triangle_optimized' function'

q

* Modified 'pascal_triangle' prgram

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

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

* Update pascal_triangle.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-31 17:58:42 +01:00
Christian Clauss
a31edd4477
Test on Python 3.11 (#6591)
* Test on Python 3.11 release candidate 2

* tensorflow; python<3.11

* tensorflow; python_version < 3.11

* tensorflow; python_version < "3.11"

* sympy, tensorflow; python_version < "3.11"

* sklearn; python_version < "3.11"

* matplotlib, pandas, qiskit

* statsmodels; python_version < "3.11"

* Bring back Pandas

* Problem deps are qiskit, statsmodels, and tensorflow

* updating DIRECTORY.md

* python-version: 3.11-dev --> 3.11

* updating DIRECTORY.md

* Add pytest --ignore to pyproject.toml

* Update build.yml

* Update pyproject.toml

* Update pyproject.toml

* Python 3.11

Co-authored-by: github-actions <${GITHUB_ACTOR}@users.noreply.github.com>
2022-10-31 14:50:03 +01:00
Alex de la Cruz
b2165a65fc
Added Radix Tree in data structures (#6616)
* added radix tree to data structures

* added doctests

* solved flake8

* added type hints

* added description for delete function

* Update data_structures/trie/radix_tree.py

* Update radix_tree.py

* Update radix_tree.py

* Update radix_tree.py

Co-authored-by: Alex de la Cruz <alex@Alexs-MacBook-Air.local>
Co-authored-by: Christian Clauss <cclauss@me.com>
2022-10-31 14:14:33 +01:00
Roberts
0fd1ccb133
Adding inductive reactance calculation (#6625)
* Adding inductive reactance calculation

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

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

* from math import pi

* 0007957747154594767

* 36420441699332

* 2199114857512855

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-31 12:31:15 +01:00
Tianyi Zheng
39e5bc5980
Refactor bottom-up edit distance function to be class method (#7347)
* Refactor bottom-up function to be class method

* Add type hints

* Update convolve function namespace

* Remove depreciated np.float

* updating DIRECTORY.md

* updating DIRECTORY.md

* updating DIRECTORY.md

* updating DIRECTORY.md

* Renamed function for consistency

* updating DIRECTORY.md

Co-authored-by: github-actions <${GITHUB_ACTOR}@users.noreply.github.com>
Co-authored-by: Chris O <46587501+ChrisO345@users.noreply.github.com>
2022-10-31 18:13:21 +13:00
himanshit0304
f8958ebe20
Add print_multiplication_table.py (#6607)
* Add print_multiplication_table.py

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

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

* Added return type description

* Update print_multiplication_table.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-30 23:55:11 +01:00
Gmuslow
c0168cd33f
Created equivalent_resistance under Electronics (#6782)
* Create resistor_equivalence.py

* Update resistor_equivalence.py

* Update electronics/resistor_equivalence.py

removed an unnecessary space

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

* Update resistor_equivalence.py

fixed the snake_case requirement

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

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

* Update resistor_equivalence.py

finalize the naming convention errors (hopefully)

* Update resistor_equivalence.py

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

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

Co-authored-by: Caeden <caedenperelliharris@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-30 22:33:13 +01:00
Abhishek Chakraborty
e12516debb
Shear stress: typo + WIkipedia URL (#7896) 2022-10-30 22:11:05 +01:00
Gautam Chaurasia
11e6c6fcc4
Added algorithm for finding index of rightmost set bit (#7234)
* Added algorithm for finding index of rightmost set bit

* applied suggested changes

* applied suggested changes

* Fixed failing Testcases

* [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-30 14:28:27 +01:00
Agniv Ghosh
47100b992a
Added code for palindrome partitioning problem under dynamic programming (#7222)
* Added code for palindrome partitioning problem under dynamic programming

* Updated return type for function

* Updated Line 24 according to suggestions

* Apply suggestions from code review

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

* Update palindrome_partitioning.py

* Update palindrome_partitioning.py

* is_palindromic

Co-authored-by: Christian Clauss <cclauss@me.com>
Co-authored-by: Caeden Perelli-Harris <caedenperelliharris@gmail.com>
2022-10-30 14:15:46 +01:00
Wissam Fawaz
d1430aa36b
Implemented a Pascal triangle generator (#7317)
* Added a Pascal triangle implementation to the other folder

* Added Pascal triangle implementation to the other folder.

* Added Pascal triangle implementation to the other folder.

* Added Pascal triangle implementation to the other folder.

* Implemented a Pascal triangle generator.

* Reversed Changes to DIRECTORY.md

* Reversed changed to .md files

* Update other/pascal_triangle.py

Removed personal info

Co-authored-by: Paul <56065602+ZeroDayOwl@users.noreply.github.com>

* Update pascal_triangle.py

Expanded the description of the algorithm

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

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

* Printed output in triangular form

* Update CONTRIBUTING.md

Co-authored-by: Paul <56065602+ZeroDayOwl@users.noreply.github.com>
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
2022-10-30 14:14:22 +01:00
Alexander Pantyukhin
cf915e7042
add Levinstein distance with Dynamic Programming: up -> down approach (#7171)
* add Levinstein distance with Dynamic Programming: up -> down approach

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

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

* add type hint

* fix flake8

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

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

* Update dynamic_programming/min_distance_up_bottom.py

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

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

* Update min_distance_up_bottom.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>
2022-10-30 14:00:16 +01:00
kumarsurajsk
2c65597093
addition_without_arithmetic (#6830)
* Addition_without_arithmetic

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

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

* added_param

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

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

* added_param_in_first_sec

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

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

* change_align

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

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

* Update Addition_without_arithmetic.py

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

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

* Rename Addition_without_arithmetic.py to addition_without_arithmetic.py

* Update addition_without_arithmetic.py

* Update addition_without_arithmetic.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-30 13:52:37 +01:00
Kushagra Makharia
69d04ff644
Added mean absolute error in linear regression (#7003)
* Added mean absolute error in linear regression

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

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

* Code feedback changes

* [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: Caeden Perelli-Harris <caedenperelliharris@gmail.com>

* Apply suggestions from code review

* Update linear_regression.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>
Co-authored-by: Caeden Perelli-Harris <caedenperelliharris@gmail.com>
2022-10-30 13:42:59 +01:00
sadiqebrahim
94b51f6a91
Added Builtin Voltage (#7850)
* Added Builtin Voltage

* Update builtin_voltage.py

* Update electronics/builtin_voltage.py

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

* Update electronics/builtin_voltage.py

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

* [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: Caeden Perelli-Harris <caedenperelliharris@gmail.com>

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

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

* Create elf.py

Co-authored-by: Caeden Perelli-Harris <caedenperelliharris@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-30 12:52:20 +01:00
Jeremias Moreira Gomes
ab9d8f3874
Adding a Quine in Python. (#6807)
* Adding a Quine in Python.

* [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-30 12:09:23 +01:00
Lukas Esc
cafbbab125
shortened code using abs() and inplace ops (#7191)
n = -n if n < 0 else n --> n = abs(n)
n = n // 10 --> n //= 10
2022-10-30 11:56:54 +01:00
Dima I
9278d0c6cd
Added archimedes principle (physics) (#7143)
* Added archimedes principle (physics)

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

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

* reformated

* reformatted archimedes principles

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
2022-10-30 11:54:23 +01:00
Emmanuel Bauma Murairi
b5d7f186f4
Polynomial (#6745)
* implement function to handle polynomial operations

* edit documentation

* fix type hint and linter errors

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

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

* fix short variable name

* fix spelling

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
2022-10-30 11:52:50 +01:00
Pravin
cc42300780
Added Readme file to document the hashing algorithm. (#6743)
* Added Readme file to document the hashing algorithm.

* [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-30 11:50:08 +01:00
Micael Pereira
6b6d8cc111
Adding ELFHash Algorithm (#6731)
* Adding ELFHash Algorithm

Adding a new Hash Algorithm.

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

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

* Update elf.py

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

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

* Update elf.py

* Update elf.py

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

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

* Update elf.py

* Apply suggestions from code review

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

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: Caeden <caedenperelliharris@gmail.com>
2022-10-30 11:49:22 +01:00
happiestbee
00fc53de97
added sumset.py Fixes: #{6563} (#6742)
* Create sumset.py

* updating DIRECTORY.md

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

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

* Add descriptive var names

* Update maths/sumset.py

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

* Update sumset.py

* updating DIRECTORY.md

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: Caeden <caedenperelliharris@gmail.com>
Co-authored-by: Christian Clauss <cclauss@me.com>
2022-10-30 11:49:05 +01:00
samyakpagariya
fcfe35c3d8
For the better understanding of time taken. (#6583)
* For the better understanding of time taken.

In this change I have initialized a variable p with the value of (1e9+7) and then took the modulus of process time with it . This modification gives better time taken by the process . Firstly it was giving answer in the exponential now it gives in the integer form.

* [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: Caeden Perelli-Harris <caedenperelliharris@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>
Co-authored-by: Caeden Perelli-Harris <caedenperelliharris@gmail.com>
2022-10-30 11:43:41 +01:00
Kavienan J
b32903d22f
Add root mean square speed of gas molecules to physics (#6569)
* add rms speed of molecule to physics

* Update physics/rms_speed_of_molecule.py

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

Co-authored-by: Christian Clauss <cclauss@me.com>
Co-authored-by: Caeden Perelli-Harris <caedenperelliharris@gmail.com>
2022-10-30 11:29:00 +01:00
Kavienan J
c0b0b128b7
Add Ideal Gas Law for physics (#6503)
* add physics ideal gas law

* run pre commit

* Update physics/ideal_gas_law.py

Suggestion #1

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

* Update physics/ideal_gas_law.py

Suggestion #2

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

* run pre commit

* Update volume return line sugesstion

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

* Add suggestions

* Apply suggestions from code review

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

Co-authored-by: Caeden <caedenperelliharris@gmail.com>
Co-authored-by: Christian Clauss <cclauss@me.com>
2022-10-30 11:26:46 +01:00
Si Lam
ca923389c0
Description of Double hasing (#6467)
* Description of DOuble hasing

* Fix sheebang

* Update double_hash.py

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

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

* Update double_hash.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>
2022-10-30 11:25:51 +01:00
Devesh Swarnkar
ba576a9a0b
Create README.md (#6642)
for blockchain file
2022-10-30 11:14:02 +01:00
Caeden Perelli-Harris
48a73a28d4
fix(quantum): Correct simulator deprecation (#7869) 2022-10-30 11:11:29 +01:00
Saksham1970
84facb78b2
Project Euler: 092 decreased the time (#6627)
* Added explanation and increased speed of the solution of problem 092

* updating DIRECTORY.md

* Added temporary fix to the failing of problem 104

* Reduced few seconds by minor improvements

* Update sol.py

Co-authored-by: github-actions <${GITHUB_ACTOR}@users.noreply.github.com>
Co-authored-by: Christian Clauss <cclauss@me.com>
2022-10-30 11:10:16 +01:00
giladwo
00dfad9d20
Simplify climbing stairs and use constant memory (#6628)
* Simplify climbing stairs and use constant memory

* number_of_steps

Co-authored-by: Christian Clauss <cclauss@me.com>
2022-10-30 10:59:10 +01:00
Kevin Joven
87a5d91976
quantum_teleportation.py (#6632)
* quantum_teleportation.py

This code is for the #Hacktoberfest.
This file run the quantum teleportation circuit using Qiskit.

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

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

* Update quantum/quantum_teleportation.py

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

* Update quantum/quantum_teleportation.py

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

* Update

Corrected some typos. 
Add more comments for adding the gates.
Update the variable qc with quantum_circuit in the simulator and execute.

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

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

* python return typehint solved.

* Fix long line

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: Caeden <caedenperelliharris@gmail.com>
Co-authored-by: Christian Clauss <cclauss@me.com>
2022-10-30 10:49:33 +01:00
Sushant Srivastav
5ba5c54858
Updated info (#7866)
* Updated info

Updated the readme section for sorts.

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

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

* Update sorts/README.md

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

* Update README.md

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: Caeden Perelli-Harris <caedenperelliharris@gmail.com>
Co-authored-by: Christian Clauss <cclauss@me.com>
2022-10-30 10:08:54 +01:00
Andrey
57ccabbaeb
Update docs (#7867)
* Update docs, remove unused excludes from pre-commit

* updating DIRECTORY.md

Co-authored-by: github-actions <${GITHUB_ACTOR}@users.noreply.github.com>
2022-10-30 10:01:58 +01:00
Carlos Villar
17d93cab78
Added Manhattan distance algorithm (#7790)
* Added Manhattan distance algorithm, Fixes: #7776

* Forgot that isinstance can accept a tuple

* Apply suggestions from code review

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

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

* Update manhattan_distance.py

* Update manhattan_distance.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>
2022-10-30 10:00:47 +01:00
lostybtw
f87de60b6d
fizzbuzz complete (#6504)
* fizzbuzz

* Update dynamic_programming/fizz_buzz.py

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

* Update dynamic_programming/fizz_buzz.py

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

* Update dynamic_programming/fizz_buzz.py

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

* Update dynamic_programming/fizz_buzz.py

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

* Update dynamic_programming/fizz_buzz.py

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

* added doctests and function to fizzbuzz

* Update fizz_buzz.py

* Update fizz_buzz.py

* Fixed FizzBuzz

* fizzbuzz passing test

* Update dynamic_programming/fizz_buzz.py

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

* Update dynamic_programming/fizz_buzz.py

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

* Update dynamic_programming/fizz_buzz.py

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

* Update dynamic_programming/fizz_buzz.py

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

* Update fizz_buzz.py

* Update fizz_buzz.py

* Update fizz_buzz.py

* fixed fizzbuzz

* Add files via upload

* added mechanical energy calculation

* Delete mechanical_energy.py

* Update fizz_buzz.py

* Update dynamic_programming/fizz_buzz.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

* Update fizz_buzz.py

Co-authored-by: Caeden <caedenperelliharris@gmail.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>
2022-10-30 08:22:52 +01:00
ok-open-sc
0c5f1c0130
Increased Readability Of Variables (#6400)
* Increased Readability Of Variables

* Update anagrams.py

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

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

* Update anagrams.py

* [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>
2022-10-30 08:11:17 +01:00
Caio Cordeiro
f340bde6e0
Add simple neural network (#6452)
* feat: add simple foward propagation implementation

* fix: add PR requested changes

* feat: add code example

* fix: solve pre-commit failure

* feat: add doctest inside code execution

* fix: PR requested changes

* fix: pr requested changes

Co-authored-by: Caio Cordeiro <ccordeirodemorae@apple.com>
2022-10-30 08:05:44 +01:00
Itssxxsalman
2d3985006f
Fix grammatical mistakes in simple_keyword_cypher.py (#6385)
* Fixed grammitical mistake

* Update ciphers/simple_keyword_cypher.py

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

Co-authored-by: Christian Clauss <cclauss@me.com>
Co-authored-by: Caeden Perelli-Harris <caedenperelliharris@gmail.com>
2022-10-30 08:03:28 +01:00
Jason Devers
7b7b3dd086
matrix/count_paths.py (#7533)
* added recursive dfs backtracking for count paths with doctests

* fixed doc testing

* added type hints

* redefined r as row, c as col

* fixed naming conventions, ran mypy, only tests that didn't pass were using List[], rathan list()

* added another doctest, as well as a explanation above

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

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

* Update matrix/count_paths.py

Co-authored-by: Chris O <46587501+ChrisO345@users.noreply.github.com>

* Update matrix/count_paths.py

Co-authored-by: Chris O <46587501+ChrisO345@users.noreply.github.com>

* [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: Caeden Perelli-Harris <caedenperelliharris@gmail.com>

Co-authored-by: J <jasondevers@wireless-10-105-49-243.umd.edu>
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: Chris O <46587501+ChrisO345@users.noreply.github.com>
Co-authored-by: Caeden Perelli-Harris <caedenperelliharris@gmail.com>
2022-10-30 18:20:07 +13:00
SparshRastogi
3ec0aa85c0
Update kinetic_energy.py (#7848)
Fixed a typo error in docstrings
2022-10-29 23:24:59 +02:00
Andrey
1550731cb7
Remove file-level flake8 suppression (#7844)
* Remove file-level flake8 suppression

* updating DIRECTORY.md

* Fix tests

Co-authored-by: github-actions <${GITHUB_ACTOR}@users.noreply.github.com>
2022-10-29 22:45:21 +02:00
Kushagra Makharia
47ddba1d91
Added cosine similarity (#7001)
* Added cosine similarity

* [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-29 17:38:40 +02:00
Shashank Kashyap
bd50a30682
Resonant Frequency & Electrical Impedance (#6983)
* Resonant Frequency

* Resonant Frequency of LC Circuit

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

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

* Update electronics/resonant_frequency.py

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

* Update electronics/resonant_frequency.py

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

* Update electronics/resonant_frequency.py

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

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

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

* Updated resonant_frequency.py

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

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

* Update electronics/resonant_frequency.py

Co-authored-by: Paul <56065602+ZeroDayOwl@users.noreply.github.com>

* Fixed doctest issues in resonant_frequency.py

* Algorithm for Electrical Impedance

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

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

* Updated Algorithm for Electrical Impedance

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

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

* Update resonant_frequency.py

* Update electrical_impedance.py

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

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

* Update resonant_frequency.py

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

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

* Update electronics/electrical_impedance.py

Co-authored-by: Paul <56065602+ZeroDayOwl@users.noreply.github.com>

* Update electronics/electrical_impedance.py

Co-authored-by: Paul <56065602+ZeroDayOwl@users.noreply.github.com>

* Update electronics/resonant_frequency.py

Co-authored-by: Paul <56065602+ZeroDayOwl@users.noreply.github.com>

* [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: Caeden <caedenperelliharris@gmail.com>
Co-authored-by: Paul <56065602+ZeroDayOwl@users.noreply.github.com>
2022-10-29 17:25:26 +02:00
dmorozov001
d84452344a
Correcting typos in CONTRIBUTING.md (#7845) 2022-10-29 16:43:03 +02:00
Harsh Verma
a02e7a1331
Added algorithm for Text Justification in Strings (#7354)
* Added algorithm for Text Justification in Strings

* Added algorithm for Text Justification in Strings
2022-10-29 15:54:32 +02:00
sadiqebrahim
038f8a00e5
add electric conductivity algorithm (#7449)
* add electric conductivity algorithm

* Update electric_conductivity.py

* Apply suggestions from code review

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

* Update electric_conductivity.py

* Update electric_conductivity.py

* Update electric_conductivity.py

* add algorithm

Co-authored-by: Caeden Perelli-Harris <caedenperelliharris@gmail.com>
2022-10-29 15:52:19 +02:00
Carlos Villar
7b521b66cf
Add Viterbi algorithm (#7509)
* Added Viterbi algorithm Fixes: #7465

Squashed commits

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

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

* Added doctest for validators

* moved all extracted functions to the main function

* Forgot a type hint

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
2022-10-29 15:44:18 +02:00
Anshraj Shrivastava
efb4a3aee8
added algo for finding permutations of an array (#7614)
* Add files via upload

* Delete permutations.cpython-310.pyc

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

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

* Update permutations.py

* Update permutations.py

* Add files via upload

* Delete permutations.py

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

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

* Update permutations.py

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

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

* Update permutations.py

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

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

* Update permutations.py

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

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

* Update data_structures/arrays/permutations.py

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

* Update permutations.py

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

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

* Update permutations.py

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

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

* Update data_structures/arrays/permutations.py

Co-authored-by: Chris O <46587501+ChrisO345@users.noreply.github.com>

* Update permutations.py

* Update permutations.py

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

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

* Update permutations.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>
Co-authored-by: Chris O <46587501+ChrisO345@users.noreply.github.com>
2022-10-29 15:29:15 +02:00
JatinR05
93ad7db97f
Create recursive_approach_knapsack.py (#7587)
* Create recursive_approach_knapsack.py

Added a new naïve recursive approach to solve the knapsack problem.

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

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

* Update recursive_approach_knapsack.py

Updated the code

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

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

* Update recursive_approach_knapsack.py

Updated

* [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-29 15:28:12 +02:00
Andrey
584e743422
Fix yesqa hook (#7843)
* fix yesqa hook

* Remove redundant noqa

* updating DIRECTORY.md

Co-authored-by: github-actions <${GITHUB_ACTOR}@users.noreply.github.com>
2022-10-29 15:07:02 +02:00