* Add implementation of Karger's Algorithm
* Remove print statement from karger's algorithm function
* Fix style issues in graphs/karger.py
* Change for loops to set comprehensions where appropriate in graphs/karger.py
* Correcting the Gaussian Formula
I have added the parenthesis around the 2*sigma^2 term.
* Update gaussian.py
* Update gaussian.py
* Update gaussian.py
* Update gaussian.py
* Update gaussian.py
* Update gaussian.py
Co-authored-by: Christian Clauss <cclauss@me.com>
* Added Python Program to Check Perfet Number
* CodeSpell Error Fix - 1
* Build Error Fix - 1
* Made suggested changes
* Use generator expression
* Added Python Program to Check Krishnamurthy Number or not
* Added Python Program to Check Krishnamurthy Number
* Added Python Program to Check Krishnamurthy Number or not
* Build Error Fix - 1
* Build Error Fix - 2
* Fix Brackets positions
* Fix Character Exceeding Error
* Made Review Changes
* Build Error Fix - 3
* Build Error Fix - 4
* Update krishnamurthy_number.py
Co-authored-by: Christian Clauss <cclauss@me.com>
* added type hints and doctests to arithmetic_analysis/bisection.py
continuing in line with #2128
* modified arithmetic_analysis/bisection.py
Put back print statement at the end, replaced algorithm's print statement with an exception.
* modified arithmetic_analysis/bisection.py
Removed unnecessary type import "Optional"
* modified arithmetic_analysis/bisection.py
Replaced generic Exception with ValueError.
* modified arithmetic_analysis/bisection.py
fixed doctests
* Initial commit of power iteration.
* Added more documentation for power iteration and rayleigh quotient
* Type hinting for rayleigh quotient
* Changes after running black and flake8.
* Added doctests, added unit tests. Removed Rayleigh quotient as it is not needed.
* Update linear_algebra/src/power_iteration.py
Changed convergence check line.
Co-authored-by: Christian Clauss <cclauss@me.com>
* Update linear_algebra/src/power_iteration.py
Named tests more clearly.
Co-authored-by: Christian Clauss <cclauss@me.com>
* Changed naming in test function to be more clear. Changed naming in doctests to match function call.
* Self running tests
Co-authored-by: Zeyad Zaky <zeyadzaky@Zeyads-MacBook-Pro.local>
Co-authored-by: Christian Clauss <cclauss@me.com>
* Add merge insertion sort
* Fix python naming conventions
* Add wikipedia link
* Add type hint
* Fix python to python3
Co-authored-by: Christian Clauss <cclauss@me.com>
* Refactor doubled process in if-condition into one outside of if-condition
Co-authored-by: Christian Clauss <cclauss@me.com>
* Refactor make python3 prior to python
Co-authored-by: Christian Clauss <cclauss@me.com>
* Fix name of is_surplus into has_last_odd_item
* Add comment
* Fix long comment to shorten
Co-authored-by: Christian Clauss <cclauss@me.com>
* added conversions between celsius and fahrenheit
* Renamed celsius_to_fahrenheit.py
* Fixed spelling issues
* modified file to fit the 88-character limit
* added changes to pass the travis-ci test
* further changed the files to pass the travis-ci test
* further changed the files to pass the travis-ci test
* Shortened conversions/fahrenheit_to_celsius.py
Co-authored-by: Christian Clauss <cclauss@me.com>
* Type hints added to conversions/fahrenheit_to_celsius.py
Co-authored-by: Christian Clauss <cclauss@me.com>
* changed the code to let the caller do the printing
* addressed the changes made on github
* Added Kelvin conversions and put temperature functions in a single file
* Removed whitespace from a blank line
* Update temperature_conversions.py
Co-authored-by: Christian Clauss <cclauss@me.com>
* Added Standardization and Normalization algorithms with built-in stats
* Implement ndigits for rounding
Co-authored-by: Christian Clauss <cclauss@me.com>
* add new file for another solution to the n queens problem
* Add the code for the algorithm, add comments and add at the top a general explanation
* Update backtracking/n_queens_math.py
Co-authored-by: Christian Clauss <cclauss@me.com>
* Update backtracking/n_queens_math.py
Co-authored-by: Christian Clauss <cclauss@me.com>
* Update backtracking/n_queens_math.py
Co-authored-by: Christian Clauss <cclauss@me.com>
* Update backtracking/n_queens_math.py
Co-authored-by: Christian Clauss <cclauss@me.com>
* No newline at the end of the file
* Type hints
* whitespaces fixed
* Fixed whitespaces
* Add type hints
* CodeSpell fixed
* update
* All changes made except changing the board variable to local
* Add doctest
* Update
* Update
* Update
* Update n_queens_math.py
Co-authored-by: Christian Clauss <cclauss@me.com>
* add surface area class
* add new line to end of file
* move surface area class into area class
* add missing import
* added pi import
* fix typo
* added blank line
* fixed more import issues
* comment fix
* comment fixes
* Gale Shapley Algorithm
Implementation of a Nobel prize-winning algorithm that determines a stable matching in a bipartite graph.
* Update graphs/gale_shapley_bigraph.py
Co-authored-by: Christian Clauss <cclauss@me.com>
* Fixed some flake8 issues.
* Updated it to donors and recipients
* description changes
Co-authored-by: Christian Clauss <cclauss@me.com>
* description changes
Co-authored-by: Christian Clauss <cclauss@me.com>
* description changes
Co-authored-by: Christian Clauss <cclauss@me.com>
* Edited the line lengths
* Update gale_shapley_bigraph.py
* Update gale_shapley_bigraph.py
Co-authored-by: Christian Clauss <cclauss@me.com>
* black format
* updating DIRECTORY.md
* fixes
* fixup! Format Python code with psf/black push
Co-authored-by: github-actions <${GITHUB_ACTOR}@users.noreply.github.com>
* Add typing for bfs
* Add url for BFS
* rename the function
Co-authored-by: Christian Clauss <cclauss@me.com>
* Update graphs/bfs.py
Co-authored-by: Christian Clauss <cclauss@me.com>
* Change the return value type of bfs
* change the function name.
change all instances of bfs() to breadth_first_search().
* change the function name in annotate
* Add one more blank line.
* Delete one blank line.
* Delete one blank line.
I've read the https://www.flake8rules.com/rules/W391.html, and still don't know how to do it. I've tried using 0 ,1,2 blank lines...
* Update graphs/bfs.py
Co-authored-by: Christian Clauss <cclauss@me.com>
* Update graphs/bfs.py
Co-authored-by: Christian Clauss <cclauss@me.com>
* Rename bfs.py to breadth_first_search_2.py
Co-authored-by: Christian Clauss <cclauss@me.com>
* Create __init__.py
* Initial commit
Not sure if this should be formatted differently. I'm open to ideas!
* Completing testing/updates
Ran code through `black`, `flake8`, and `doctest`. Added some type hints.
`doctest` is finicky on sets, so I had to sort and reformat as set to pass those tests.
* Update project_euler/problem_47/sol1.py
Nice.
Co-authored-by: Christian Clauss <cclauss@me.com>
* Update project_euler/problem_47/sol1.py
Looks good
Co-authored-by: Christian Clauss <cclauss@me.com>
* Update project_euler/problem_47/sol1.py
Okay, this should work. Thank you for the reminder on map(), filter(), reduce().
Co-authored-by: Christian Clauss <cclauss@me.com>
* Update project_euler/problem_47/sol1.py
My IDE needs a spellchecker. Or, lighter comment font.
Co-authored-by: Christian Clauss <cclauss@me.com>
* Update project_euler/problem_47/sol1.py
Co-authored-by: Christian Clauss <cclauss@me.com>
* Update project_euler/problem_47/sol1.py
Co-authored-by: Christian Clauss <cclauss@me.com>
* Update project_euler/problem_47/sol1.py
This means that `results = run(N)` should be updated to `results = run(n)`, correct?
Co-authored-by: Christian Clauss <cclauss@me.com>
* Update project_euler/problem_47/sol1.py
Co-authored-by: Christian Clauss <cclauss@me.com>
* Update project_euler/problem_47/sol1.py
Looks good!
Co-authored-by: Christian Clauss <cclauss@me.com>
* Update project_euler/problem_47/sol1.py
Co-authored-by: Christian Clauss <cclauss@me.com>
* Update project_euler/problem_47/sol1.py
Co-authored-by: Christian Clauss <cclauss@me.com>
* Update project_euler/problem_47/sol1.py
Works for me! I spent way too much time getting this to pass doctest, so any improvement is welcome.
Co-authored-by: Christian Clauss <cclauss@me.com>
* Update sol1.py
Added some suggested changes from the pull request:
* Updated tests outputs in `unique_prime_factors` function.
* Changed `@lru_cache(maxsize=5)` to `@lru_cache(maxsize=None)`
* Removed duplicate `return` line in `equality` function
* Changed `i` to `base` in run function.
* Added some commentary to `run()` function.
* Replaced `group = list(map(lambda x: base + x, [i for i in range(n)]))` with `group = [base + i for i in range(n)]`
* Update sol1.py
* Trailing whitespace
* Update sol1.py
* Update __init__.py
* Update sol1.py
* Update __init__.py
Co-authored-by: Christian Clauss <cclauss@me.com>
* NLP Word Frequency Algorithms
* Added type hints and Wikipedia link to tf-idf
* Update machine_learning/word_frequency_functions.py
Co-authored-by: Christian Clauss <cclauss@me.com>
* Update machine_learning/word_frequency_functions.py
Co-authored-by: Christian Clauss <cclauss@me.com>
* Update machine_learning/word_frequency_functions.py
Co-authored-by: Christian Clauss <cclauss@me.com>
* Update machine_learning/word_frequency_functions.py
Co-authored-by: Christian Clauss <cclauss@me.com>
* Fix line length for flake8
* Fix line length for flake8 V2
* Add line escapes and change int to float
* Corrected doctests
* Fix for TravisCI
* Fix for TravisCI V2
* Tests passing locally
* Tests passing locally
* Update machine_learning/word_frequency_functions.py
Co-authored-by: Christian Clauss <cclauss@me.com>
* Update machine_learning/word_frequency_functions.py
Co-authored-by: Christian Clauss <cclauss@me.com>
* Update machine_learning/word_frequency_functions.py
Co-authored-by: Christian Clauss <cclauss@me.com>
* Update machine_learning/word_frequency_functions.py
Co-authored-by: Christian Clauss <cclauss@me.com>
* Add doctest examples and clean up docstrings
Co-authored-by: Christian Clauss <cclauss@me.com>