* adding static type checking to basic_binary_tree.py
* Add static type checking to functions with None return type
* Applying code review comments
* Added missing import statement
* fix spaciing
* "cleaned up depth_of_tree"
* Add doctests and then streamline display() and is_full_binary_tree()
Co-authored-by: Christian Clauss <cclauss@me.com>
* PIL.Image.point() takes an int, not a float
@furkanatesli Trying to remove these warnings from our Travis CI build logs...
https://travis-ci.com/github/TheAlgorithms/Python/builds/178602503#L809
* fixup! Format Python code with psf/black push
* Revert changes to change_brightness.py
* updating DIRECTORY.md
Co-authored-by: github-actions <${GITHUB_ACTOR}@users.noreply.github.com>
* More efficient least common multiple.
* lowest -> least
* integer division
* Update least_common_multiple.py
Co-authored-by: Christian Clauss <cclauss@me.com>
* Josephus problem in Python
Added the code for the josephus problem in python using circular linked lists.
* Update josephus_problem.py
* Added World covid19 stats in web programming
* Delete josephus_problem.py
* Type hints, algorithmic functions should not print
Return a dict of world covid19 stats. Move all printing into the main functions.
* Update world_covid19_stats.py
* Update world_covid19_stats.py
Co-authored-by: Christian Clauss <cclauss@me.com>
* Fix doubly linked list algorithm
* Fix bug with insert_at_tail method
Create __str__() method for Node class and LinkedList class
* Simplify __str__() of LinkedList
Returns empty string if there are no elements in the list
* Fix description
* added type hints and doctests to arithmetic_analysis/newton_method.py
Continuing #2128
Also changed some variable names, made them more descriptive.
* Added type hints and doctests to arithmetic_analysis/newton_method.py
added a type alias for Callable[[float], float] and cleaned up the exception handling
* added type hints and doctests to arithmetic_analysis/newton_method.py
improved exception handling
* Update newton_method.py
Co-authored-by: Christian Clauss <cclauss@me.com>
* 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