* boruvka.py: A few simplifications and f-strings
Python f-strings simplify the code and [should speed up execution](https://www.scivision.dev/python-f-string-speed).
@srkchowdary2000 Your review, please.
* updating DIRECTORY.md
* fixup! Streamline the test
Co-authored-by: github-actions <${GITHUB_ACTOR}@users.noreply.github.com>
* Added Borůvka's algorithm.
* Added Borůvka's algorithm, a graph algorithm that finds the minimum spanning tree.
* Added Borůvka's algorithm, a graph algorithm that finds the minimum spanning tree.
* Added Borůvka's algorithm, a graph algorithm that finds the minimum spanning tree.
* Added Borůvka's algorithm, a graph algorithm that finds the minimum spanning tree.
* Added Borůvka's algorithm, a graph algorithm that finds the minimum spanning tree. Solved Test Cases Errors.
* Added Borůvka's algorithm, a graph algorithm that finds the minimum spanning tree. Solved Test Cases Errors.
* Added Borůvka's algorithm, a graph algorithm that finds the minimum spanning tree. Solved Test Cases Errors.
* Added Borůvka's algorithm, a graph algorithm that finds the minimum spanning tree. Solved Test Cases Errors.
* Added Borůvka's algorithm, a graph algorithm that finds the minimum spanning tree. Solved Test Cases Errors.
* Added Borůvka's algorithm, a graph algorithm that finds the minimum spanning tree. Solved Test Cases Errors.
* Added Borůvka's algorithm, a graph algorithm that finds the minimum spanning tree. Solved Test Cases Errors.Removed WhiteSpaces.
* Added Borůvka's algorithm, a graph algorithm that finds the minimum spanning tree. Code Changes.
* Added Borůvka's algorithm, a graph algorithm that finds the minimum spanning tree. Code Changes.
* add date_to_weekday finder method
* reformat date_to_weekday method
* remove time
* remove hardcode weekdays list
* fix return type error
* fixing fail issue
* Finding the test failing issue
* after testing the pre-commit in local environment
* Fix mypy errors for maths/greedy_coin_change.py
* Fix mypy errors for maths/two_sum.py
* Fix mypy errors for maths/triplet_sum.py
* Fix the format of maths/greedy_coin_change.py
* Fix the format of maths/greedy_coin_change.py
* Fix format with pre-commit
* Create exchange_sort.py
added exchange sort
* Fixed doctest in exchange_sort.py
* Fixed formatting error and added new length variable
added empty line at end of exchange_sort.py and turned len(numbers) into a variable
* Fixed formatting errors with black
added empty line
* case switch using python
* review comments
* added type hints
* general code format
* [mypy] Fix type annotations for secant_method.py
* remove bad push
* add phone_validator method
* change the phone_validator to indian_phone_validator
* Unnecessary comments removed
* all comments deleted
* Fixes: #{} new line issue
* code reformatted using black
* fixed colons and spaces
* fixed colons and spaces
* random anime character python script
* more tests passed
* type hint updated
Co-authored-by: Christian Clauss <cclauss@me.com>
* type hint updated again
Co-authored-by: Christian Clauss <cclauss@me.com>
* Update random_anime_character.py
Co-authored-by: Christian Clauss <cclauss@me.com>
* Removes overuse of lambdas, improves readability and processing time when it finds bitstring to print out.
Removes overuse of lambdas, uses dictionary instead. This improves readability and processing time when it finds the bitstring to print out.
* Update huffman.py
* Average mean refactor
Added doctests and type hints to average_mean
* Wiki link added
* Empty list check added
Empty list check added
Type hint changed to typing.List
* Luhn algorithm
Perform Luhn validation on input string
Algorithm:
* Double every other digit starting from 2nd last digit.
* Subtract 9 if number is greater than 9.
* Sum the numbers
https://en.wikipedia.org/wiki/Luhn_algorithm
* Update DIRECTORY.md
* Update luhn.py
* Update luhn.py
* Update luhn.py
* Update luhn.py
* Update DIRECTORY.md
* Remove redundent function
After reviewing this code, I've noticed that the `is_completed` function is a redundant operation.
Increasing the number of loops required for each step of the sudoku solver.
This should remove n² operations where n is the width of the grid.
* Update sudoku.py
Remove additional newline
* Added the matrix_exponentiation.py file in maths directory
* Implemented the requested changes
* Update matrix_exponentiation.py
* resolve merge conflict with upstream branch
* add new line at end of file
* add wavelet_tree
* fix isort issue
* updating DIRECTORY.md
* fix variable names in wavelet_tree and correct typo
* Add type hints and variable renaming
* Update data_structures/binary_tree/wavelet_tree.py
Add doctests to placate the algorithm-bot, thanks to @cclauss.
Co-authored-by: Christian Clauss <cclauss@me.com>
* Move doctest to individual functions and reformat code
* Move common test array to the global scope and reuse in tests
* MMove test array to global scope and minor linting changes
* Correct the failing pytest tests
* MUse built-in list for type annotation
* Update wavelet_tree.py
* types-requests
* updating DIRECTORY.md
* Update wavelet_tree.py
* # type: ignore
* # type: ignore
* Update decrypt_caesar_with_chi_squared.py
* ,
* Update decrypt_caesar_with_chi_squared.py
Co-authored-by: Christian Clauss <cclauss@me.com>
Co-authored-by: github-actions <${GITHUB_ACTOR}@users.noreply.github.com>
Co-authored-by: Aniruddha Bhattacharjee <aniruddha@Aniruddhas-MacBook-Air.local>
A serious bug was addressed with this pull request. The mode function previously
didn't return the mode of the input list. Instead, it always returned the first value.
Due to lacking tests, the bug was never caught. This pull request also adds new
functionality to the function, allowing support for more than one mode.
See #4464 for details.
* * Mistake in average_mode.py fixed. The previous solution was to returnthe
value on the first loop iteration, which is not correct, more than that it
used to delete repeating values, so result's array and check array lost
relation between each other
* Type hint added
* redundant check_list deleted
Co-authored-by: Maxim R. <49735721+mrmaxguns@users.noreply.github.com>
* Suggestions resolved
* output typing changed to Any
* test cases added
* Black done
File formatted
* Unused statistics import
statistics only used in doctest, now they are imported in doctest
* Several modes support added
Several modes support added
* Comment fix
* Update maths/average_mode.py
Co-authored-by: Maxim R. <49735721+mrmaxguns@users.noreply.github.com>
* Suggestions added
Co-authored-by: Maxim R. <49735721+mrmaxguns@users.noreply.github.com>