-
Sponsor
Sponsor TheAlgorithms/Python
- Notifications
- Star 116k
- Fork 31.3k
master
Commits on Aug 31, 2021
-
Approve functions used as default arguments (#4699)
* Approve functions used as default argumenets * The default value for **seed** is the result of a function call The default value for **seed** is the result of a function call which is not normally recommended and causes flake8-bugbear to raise a B008 error. However, in this case, it is accptable because `LinearCongruentialGenerator.__init__()` will only be called once per instance and it ensures that each instance will generate a unique sequence of numbers. * The default value for **backend** is the result of a function call The default value for **backend** is the result of a function call which is not normally recommended and causes flake8-bugbear to raise a B008 error. However, in this case, it is accptable because `Aer.get_backend()` is called when the function is definition and that same backend is then reused for function calls. * Update linear_congruential_generator.py * Update ripple_adder_classic.py * Update ripple_adder_classic.py * Update ripple_adder_classic.py * Update ripple_adder_classic.py * Update ripple_adder_classic.py
-
Commits on Aug 30, 2021
Commits on Aug 28, 2021
-
[fixed] unused variable, standalone running, import doctest module (#…
…4673) * [fixed] unused variable, standalone running, import doctest module information [standalone running](https://www.geeksforgeeks.org/what-does-the-if-__name__-__main__-do/) Signed-off-by: slowy07 <slowy.arfy@gmail.com> * Update other/fischer_yates_shuffle.py Co-authored-by: Christian Clauss <cclauss@me.com> * [fixed] change to tuple and fixing callfunction Signed-off-by: slowy07 <slowy.arfy@gmail.com> * Update matrix/spiral_print.py Co-authored-by: Christian Clauss <cclauss@me.com> * Update matrix/spiral_print.py Co-authored-by: Christian Clauss <cclauss@me.com> * fixing Co-authored-by: Christian Clauss <cclauss@me.com> * [fixed] sprial matrix Signed-off-by: slowy07 <slowy.arfy@gmail.com> * Update spiral_print.py * Update spiral_print.py * Update spiral_print.py * Update spiral_print.py Co-authored-by: Christian Clauss <cclauss@me.com>
Commits on Aug 27, 2021
-
luhn.py: Favor list comprehensions over maps (#4663)
* luhn.py: Favor list comprehensions over maps As discussed in CONTRIBUTING.md. * updating DIRECTORY.md Co-authored-by: github-actions <${GITHUB_ACTOR}@users.noreply.github.com>
Commits on Aug 25, 2021
-
[mypy] Fix type annotations for strings (#4641)
* Fix mypy error for min_cost_string_conversion.py * Fix mypy error for manacher.py * Fix mypy error for aho_corasick.py
Commits on Aug 24, 2021
-
boruvka.py: A few simplifications and f-strings (#4660)
* 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>
Commits on Aug 23, 2021
-
Added Borůvka's algorithm. (#4645)
* 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.
Commits on Aug 19, 2021
-
[mypy] Fix type annotations for strings (#4637)
* Fix mypy error for can_string_be_rearranged_as_pal * Fix mypy error for levenshtein_distance.py * Fix mypy error for word_patterns.py * Fix mypy error for word_occurrence.py
Commits on Aug 18, 2021
-
add date_to_weekday finder method (#4599)
* 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
-
[mypy] Fix type annotations for maths (#4617)
* Fix mypy errors for armstrong_numbers.py * Fix mypy errors for harmonic_series.py * Fix mypy errors for average_median.py
-
[mypy] Fix type annotations for graphs (#4622)
* Fix mypy error for frequent_pattern_graph_miner.py * Fix mypy error for markov_chain.py
Commits on Aug 15, 2021
-
Fix mypy error at maths (#4613)
* 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 (#4600)
* 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
Commits on Aug 13, 2021
Commits on Aug 11, 2021
Commits on Aug 8, 2021
-
Created check_valid_ip_address.py (#4602)
* Created check_valid_ip_address.py * fixed typos error Co-authored-by: root <root@localhost.localdomain>
Commits on Aug 6, 2021
-
add alternative_string_arrange method (#4595)
* add alternative_string_arrange method * fix issue * fix one more issue * changed the variable name li to output_list
Commits on Aug 3, 2021
Commits on Aug 2, 2021
Commits on Jul 29, 2021
Commits on Jul 28, 2021
Commits on Jul 27, 2021
Commits on Jul 26, 2021
-
[fixed] module 'numpy' is imported with both 'import' and 'import fro…
…m' (#4544) * [fixed] module 'numy' is imported with both 'import' and 'import from' * remove commented
-
Commits on Jul 21, 2021
-
[Mypy fix] fix secant method (#4501)
* case switch using python * review comments * added type hints * general code format * [mypy] Fix type annotations for secant_method.py * remove bad push
-
Commits on Jul 20, 2021
-
-
-
add phone_validator method (#4552)
* 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
Commits on Jul 19, 2021
-
Random anime character info (#4553)
* 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>
Commits on Jul 12, 2021
-
Improves readability and processing time (#4510)
* 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