Skip to content

my pull #1

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 109 commits into from
Feb 3, 2021
Merged

my pull #1

merged 109 commits into from
Feb 3, 2021

Conversation

DevanshiPatel18
Copy link
Owner

Describe your change:

  • Add an algorithm?
  • Fix a bug or typo in an existing algorithm?
  • Documentation change?

Checklist:

  • I have read CONTRIBUTING.md.
  • This pull request is all my own work -- I have not plagiarized.
  • I know that pull requests will not be merged if they fail the automated tests.
  • This PR only changes one algorithm file. To ease review, please open separate PRs for separate algorithms.
  • All new Python files are placed inside an existing directory.
  • All filenames are in all lowercase characters with no spaces or dashes.
  • All functions and variable names follow Python naming conventions.
  • All function parameters and return values are annotated with Python type hints.
  • All functions have doctests that pass the automated testing.
  • All new algorithms have a URL in its comments that points to Wikipedia or other similar explanation.
  • If this pull request resolves one or more open issues then the commit message contains Fixes: #{$ISSUE_NO}.

taseikyo and others added 30 commits October 29, 2020 08:35
- update naming style to snake_case
- add type hints
* Added IBM Qiskit References

* space

Co-authored-by: John Law <[email protected]>
* Implement the melkman anlgorithm for computing convex hulls

* Link melkman algorithm description

* Format melkman algorithm code

* Add type hints to functions

* Fix build errors
* Added solution to problem 58

* Update sol1.py

Co-authored-by: John Law <[email protected]>
* adding doctest to radix_sort.py file

* fixup! Format Python code with psf/black push

* Update radix_sort.py

* Update radix_sort.py

* fixup! Format Python code with psf/black push

* Update radix_sort.py

* line

* fix tests

Co-authored-by: github-actions <${GITHUB_ACTOR}@users.noreply.github.com>
Co-authored-by: John Law <[email protected]>
* Added solution for Project Euler problem 87. Fixes: #2695

* Update docstring and 0-padding in directory name. Reference: #3256
* add solution to Project Euler problem 206

* Add solution to Project Euler problem 205

* updating DIRECTORY.md

* updating DIRECTORY.md

* Revert "Add solution to Project Euler problem 205"

This reverts commit 64e3d36.

* Revert "add solution to Project Euler problem 206"

This reverts commit 53568cf.

* add solution for project euler problem 207

* updating DIRECTORY.md

* add type hint for output of helper function

* Correct default parameter value in solution

* use descriptive variable names and remove problem solution from doctest Fixes: #2695

Co-authored-by: nico <[email protected]>
Co-authored-by: github-actions <${GITHUB_ACTOR}@users.noreply.github.com>
* add type hints to math/gcd

* add doctest

* math/gcd - run black formatter

* math/gcd: remove manual doctest

* add correction to gcd of negative numbers

* add more doctest in iterative gcd
* Fixed balanced_parentheses.py

* fixed pre-commit

* eliminate is_paired

* remove unused line

* updating DIRECTORY.md

* Update data_structures/stacks/balanced_parentheses.py

Co-authored-by: Christian Clauss <[email protected]>

* Add more test cases

* Update data_structures/stacks/balanced_parentheses.py

Co-authored-by: Christian Clauss <[email protected]>

Co-authored-by: github-actions <${GITHUB_ACTOR}@users.noreply.github.com>
Co-authored-by: Christian Clauss <[email protected]>
* Simplify GitHub Actions

* Update stale.yml

Co-authored-by: Christian Clauss <[email protected]>
* Add files via upload

* Delete decimal_isolate.py

* Added decimal_isolate file.

* Update decimal_isolate.py

* Update decimal_isolate.py

* Update decimal_isolate.py

* Update decimal_isolate.py

* Update decimal_isolate.py

* Delete decimal_isolate.py

* Add files via upload

* Update maths/decimal_isolate.py

Co-authored-by: Christian Clauss <[email protected]>

* Update decimal_isolate.py

* Update decimal_isolate.py

* Update decimal_isolate.py

* Update decimal_isolate.py

Co-authored-by: Christian Clauss <[email protected]>
* Added solution to Project Euler problem 301

* Added newline to end of file

* Fixed formatting and tests

* Changed lossCount to loss_count

* Fixed default parameter value for solution

* Removed helper function and modified print stmt

* Fixed code formatting

* Optimized solution from O(n^2) to O(1) constant time

* Update sol1.py
* Add solution to problem 74

* Fix typo

* Edit unnecessary comment

* Rename folder, add default params in solution()

* Rename file to solve conflicts

* Fix doctests
* add test to infix_to_postfix_conversion

* fixed pre-commit error

* fixed build error

* updating DIRECTORY.md

Co-authored-by: github-actions <${GITHUB_ACTOR}@users.noreply.github.com>
* Readd Project Euler 206 solution for issue #2695, dupe of pull request #3042

* Add PE 206 to directory

* updating DIRECTORY.md

Co-authored-by: github-actions <${GITHUB_ACTOR}@users.noreply.github.com>
* kth order statistics divide and conquer algorithm

* add explanation of algorithm.

* fix PEP8 line too long error

* update order to be compliant to isort

* add doctest

* make file black compliant
…oefficients" (#3513)

* Added a solution for Project Euler Problem 203 (https://projecteuler.net/problem=203)

* Simplified loop that calculates the coefficients of the Pascal's Triangle. Changes based on review suggestion.

* Moved get_squared_primes_to_use function outside the get_squarefree function and fixed a failing doctest with the former.
* Added solution to Euler 64.

Added Python solution to Project Euler Problem 64.
Added a folder problem_064.
Added __init__.py file.
Added sol1.py file.

* Update sol1.py

Made formatting changes as mentioned by pre-commit

* Update sol1.py

Minor changes to variable naming and function calling as mentioned by @ruppysuppy

* Update sol1.py

Changes to function call as mentioned by @cclauss
Name: Prime square remainders

Let pn be the nth prime: 2, 3, 5, 7, 11, ..., and
let r be the remainder when (pn−1)^n + (pn+1)^n is divided by pn^2.

For example, when n = 3, p3 = 5, and 43 + 63 = 280 ≡ 5 mod 25.
The least value of n for which the remainder first exceeds 10^9 is 7037.

Find the least value of n for which the remainder first exceeds 10^10.

Reference: https://projecteuler.net/problem=123

reference: #2695

Co-authored-by: Ravi Kandasamy Sundaram <[email protected]>
* #3847 fix handling of non-ASCII characters in swap_case

* #3847 remove unused regex

* Fix formatting (with black) Fixes: #3847

* Add type hints for `swap_case` function

Co-authored-by: Frank Schmitt <[email protected]>
Co-authored-by: Dhruv Manilawala <[email protected]>
* Add project euler problem 50

* Apply format changes

* Descriptive function/parameter name and type hints

Co-authored-by: Dhruv Manilawala <[email protected]>
- update naming style to snake_case
- add type hints
* DPLL algorithm

* Corrections complete

* Formatting

* Codespell hook

* Corrections part 2

* Corrections v2

* Corrections v3

* Update and rename dpll.py to davis–putnam–logemann–loveland.py

Co-authored-by: Christian Clauss <[email protected]>
* Create molecular_chemistry.py

* round up outputs

* Remove floating point

* Add Wikipedia references

* fixup! Format Python code with psf/black push

* Add Conversions/Molecular Chemistry

* updating DIRECTORY.md

* Update molecular_chemistry.py

Co-authored-by: github-actions <${GITHUB_ACTOR}@users.noreply.github.com>
Co-authored-by: Christian Clauss <[email protected]>
* Reduce complexity linear_discriminant_analysis.

* Fix whitespace

* Update machine_learning/linear_discriminant_analysis.py

Co-authored-by: Dhruv Manilawala <[email protected]>

* fixup! Format Python code with psf/black push

* Fix format to surpass pre-commit tests

* updating DIRECTORY.md

* Update machine_learning/linear_discriminant_analysis.py

Co-authored-by: Dhruv Manilawala <[email protected]>

* fixup! Format Python code with psf/black push

Co-authored-by: Dhruv Manilawala <[email protected]>
Co-authored-by: github-actions <${GITHUB_ACTOR}@users.noreply.github.com>
* Peak of unimodal list DNC algorithm

* fix black formatting issues

* add doctest testing

* make file black compliant
* requirements: add qiskit

major library required for quantum computing

* quantum: add quantum ripple adder implementation

right now we are essentially performing the same task as a classic ripple adder

Signed-off-by: rupansh-arch <[email protected]>
joesinghh and others added 29 commits December 9, 2020 11:38
* Updated input
* Fix pre-commit error
* Add type hints, doctests, black, snake_case

Co-authored-by: Dhruv Manilawala <[email protected]>
* update graphs/breadth_first_search.py

- update naming style to snake_case
- add type hints

* add doctests
* Implemented minimum steps to one using tabulation.

* Update minimum_steps_to_one.py

Made the parameter "n" more descriptive.  Changed it to number

* `n` to `number`

Co-authored-by: John Law <[email protected]>
* Added solution for Project Euler problem 180

* Fixed minor details in Project Euler problem 180

* updating DIRECTORY.md

Co-authored-by: github-actions <${GITHUB_ACTOR}@users.noreply.github.com>
* Chore: Added type hints to searches/binary_search.py

* Use -1 as the sentinal value

* Wrap long lines

* Update binary_search.py

* Update binary_search.py

Co-authored-by: Christian Clauss <[email protected]>
* Added solution for Project Euler problem 085.

* updating DIRECTORY.md

* Minor tweaks to Project Euler problem 85

* Variable comments for project euler problem 85

Co-authored-by: github-actions <${GITHUB_ACTOR}@users.noreply.github.com>
* Update caesar_cipher.py

improved for conciseness and readability

* Add type hints

Co-authored-by: Dhruv Manilawala <[email protected]>
* Initial commit of the conjugate gradient method
* Update linear_algebra/src/conjugate_gradient.py
* Added documentation links, changed variable names to lower case and more descriptive naming, added check for symmetry in _is_matrix_spd
* Made changes to some variable naming to be more clear
* Update conjugate_gradient.py

Co-authored-by: Zeyad Zaky <[email protected]>
Co-authored-by: Christian Clauss <[email protected]>
Co-authored-by: Dhruv Manilawala <[email protected]>
* Added solution for Project Euler problem 86

* updating DIRECTORY.md

Co-authored-by: github-actions <${GITHUB_ACTOR}@users.noreply.github.com>
* Added solution for Project Euler problem 59

* updating DIRECTORY.md

* Formatting, type hints, no more evil map functions

* Doctests

* Added doctests for Project Euler problem 59

Co-authored-by: github-actions <${GITHUB_ACTOR}@users.noreply.github.com>
* fixed shell sort

* udpate code style

* Update sorts/shell_sort.py

Co-authored-by: John Law <[email protected]>

Co-authored-by: John Law <[email protected]>
* add integer to roman function

simply added fastest method i found.

* Rename roman_to_integer.py to roman_numerals.py

* Update roman_numerals.py

* Update roman_numerals.py

Co-authored-by: Christian Clauss <[email protected]>
* Added solution for Project Euler problem 101

* Got rid of map functions

* updating DIRECTORY.md

* Better function/variable names

* Better variable names

* Type hints

* Doctest for nested function

Co-authored-by: github-actions <${GITHUB_ACTOR}@users.noreply.github.com>
* Added solution for Project Euler problem 102

* Got rid of map functions

* Snake case variable names

* Type hints

* updating DIRECTORY.md

Co-authored-by: github-actions <${GITHUB_ACTOR}@users.noreply.github.com>
* Fix mypy errors for backtracking algorithms

* Fix CI failure
* Add type hints and docstrings to heap.py

- Add type hints
- Add docstrings
- Add explanatory comments 
- Improve code readability
- Change to use f-string

* Fix import sorting

* fixup! Format Python code with psf/black push

* Fix static type error

* Fix failing test

* Fix type hints

* Add return annotation

Co-authored-by: github-actions <${GITHUB_ACTOR}@users.noreply.github.com>
Co-authored-by: Dhruv Manilawala <[email protected]>
… activation function (#4037)

* added neural network with 2 hidden layers

* Revert "added neural network with 2 hidden layers"

This reverts commit fa4e2ac.

* added neural network with 2 hidden layers

* passing pre-commit requirements

* doctest completed

* added return hints

* added example

* example added

* completed doctest's

* changes made as per the review

* changes made

* changes after review

* changes

* spacing

* changed return type

* changed dtype
* Fix mypy errors for scheduling/first_come_first_served
* Fix mypy errors for scheduling/round_robin.py
* Fix mypy errors for scheduling/shortest_job_first.py
* Fix isort errors
* Added solution for Project Euler problem 107

* Doctests and better variable names

* Type hints

* Small edits

* Forward reference for typing hint

* updating DIRECTORY.md

Co-authored-by: github-actions <${GITHUB_ACTOR}@users.noreply.github.com>
* Update area.py

Modified area of triangle function. Added a new algorithm to calculate area when 3 sides are known

* Add files via upload

* Update area.py

* Update area.py

* Update area.py

* Update area.py

* Remove unnecessary whitespace

Co-authored-by: Dhruv Manilawala <[email protected]>
* new implementation for adjacency list graph

* add example code for undirected graph

* reduce length to 88 columns max to fix build errors7

* fix pre commit issues

* replace print_list method with __str__

* return object in add_edge method to enable fluent syntax

* improve class docstring and include doctests

* add end of file line

* fix pre-commit issues

* remove __str__ method

* trigger build

* Update graph_list.py

* Update graph_list.py

Co-authored-by: gnc <[email protected]>
Co-authored-by: Christian Clauss <[email protected]>
* Added code to merge two trees

* Added doctest and type hints

* Added pre-commit
* updating DIRECTORY.md

* feat: added diffie-hellman key exchange algorithm

* fix: enforce maxline length = 88

* fix: fixed import order

* fix: used flake to correct styling

* updating DIRECTORY.md

Co-authored-by: github-actions <${GITHUB_ACTOR}@users.noreply.github.com>
…ning (#4088)

* [mypy] Add/fix type annotations for similarity search in machine learning

* fix annotation

* fix annotation (Union)

* isort
* add reverse_bits.py

* check

* Delete binary_xor_operator_new.py

* Fix All the errors

Co-authored-by: xcodz-dot <[email protected]>
@DevanshiPatel18 DevanshiPatel18 merged commit 10d3aab into DevanshiPatel18:master Feb 3, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.