forked from TheAlgorithms/Python
- Notifications
You must be signed in to change notification settings - Fork 0
[pull] master from TheAlgorithms:master #103
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
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
* 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
* 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>
* 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 * case switch using python * review comments * added type hints * general code format * [mypy] Fix type annotations for secant_method.py * remove bad push
…m' (#4544) * [fixed] module 'numy' is imported with both 'import' and 'import from' * remove commented
* add alternative_string_arrange method * fix issue * fix one more issue * changed the variable name li to output_list
* Created check_valid_ip_address.py * fixed typos error Co-authored-by: root <root@localhost.localdomain>
* 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
* 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
* Fix mypy error for frequent_pattern_graph_miner.py * Fix mypy error for markov_chain.py
* Fix mypy errors for armstrong_numbers.py * Fix mypy errors for harmonic_series.py * Fix mypy errors for average_median.py
* 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 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
* 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.
* Improve Project Euler Problem 10 Sol-1 * Name correction * psf/black formatting * More formatting
* updating DIRECTORY.md * Fix typo * Improve solution Co-authored-by: github-actions <${GITHUB_ACTOR}@users.noreply.github.com> …lement.py` (#5763) * Fix type annotations in next_greater_element.py * Refactor next_greater_element.py
* DRAFT: Run a mypy reality check Let's see what is required to finish #4052 * mypy --ignore-missing-imports --install-types --non-interactive * Check our progress... * Update build.yml * Update build.yml * Update build.yml * Update build.yml * mypy --exclude 20 files * --exclude with no `=` * Update build.yml * 558 character regex!!! * With quotes * mypy.ini: mega exclude * Update mypy.ini * Update build.yml * Update mypy.ini * Update build.yml * Update mypy.ini * .py --> .p* * Escape the dots!: `.` --> `\.` * Remove the comment * Leading slash * Update mypy.ini Co-authored-by: Dylan Buchi <devybuchi@gmail.com> Co-authored-by: Dylan Buchi <devybuchi@gmail.com>
* [mypy] Fix `other/fischer_yates_shuffle.py` * Update mypy.ini
* Add equated_monthly_installments.py in Financials * Formatting * More formatting, Descriptive names * Errors with name change * Formatting * Formatting, Naming Error * dedent * Update DIRECTORY.md
* [mypy] Fix annotations in `maths/series/p_series.py` * Update p_series.py * Update p_series.py * Remove from excluded in mypy.ini * Type annotation for series * Annotate maths/proth_number.py (properly) * Remove from excluded in mypy.ini * Annotate average_mode.py * Update average_mode.py * Update average_mode.py * Update average_mode.py * Update average_mode.py * Remove from excluded in mypy.ini * Fix annotations in gamma_recursive.py * Remove from excluded in mypy.ini * Annotations for geometric_series.py * Update geometric_series.py * Update mypy.ini * Update average_mode.py * Update average_mode.py * Update average_mode.py * Update mypy.ini * Update mypy.ini * Update mypy.ini * Update average_mode.py * Update proth_number.py * Update average_mode.py * Update gamma_recursive.py * Update proth_number.py * Update mypy.ini * Update geometric_series.py * Update average_mode.py * Update proth_number.py * Update geometric_series.py * Update geometric_series.py * Update geometric_series.py * Update p_series.py * Update geometric_series.py * Update p_series.py * Update p_series.py * Update geometric_series.py * Update p_series.py * Update p_series.py * Remove data_structures/stacks/next_greater_element.py| Co-authored-by: Christian Clauss <cclauss@me.com>
* ADD the algorithms of image augmentation * ADD the algorithms of image augmentation * ADD the algorithms of image augmentation * ADD the algorithms of image augmentation * ADD the algorithms of image augmentation * ADD the algorithms of image augmentation * UPDATE format code * UPDATE format and recode structure * UPDATE format import library * UPDATE code structure * Fix all checks have failded * FIX variable format * FIX variable format * FIX variable format * FIX code structure * FIX code structure * FIX code structure * FIX code structure
* Fix type annotations in boruvka.py * Remove graphs/boruvka.py| * updating DIRECTORY.md Co-authored-by: github-actions <${GITHUB_ACTOR}@users.noreply.github.com> …andom_graph_generator.py` (#5795) * [mypy] Annotate `graphs/finding_bridges.py` * Remove from excluded in `mypy.ini` * Add doctest.testmod() * psf/black formatting * Annotations for `graphs/random_graph_generator.py` * Remove from excluded in `mypy.ini` * Resolve merge conflict * Resolve merge conflict * Update mypy.ini * Update mypy.ini * Remove from excluded
* rewrote anagrams.py, added doctests * corrected mistakes * add anagrams.txt * Update anagrams.py * Update strings/anagrams.py Co-authored-by: Christian Clauss <cclauss@me.com> Co-authored-by: Christian Clauss <cclauss@me.com>
* Type annotations for `breadth_first_search.py` * Type annotations for `breadth_first_search_2.py` * Remove from excluded in mypy.ini * Add doctest.testmod() * Type annotations for `graphs/check_cycle.py` * Type annotations for `graphs/greedy_min_vertex_cover.py` * Remove from excluded in mypy.ini
* updating DIRECTORY.md * Add solution * updating DIRECTORY.md * Fix * Fix Co-authored-by: github-actions <${GITHUB_ACTOR}@users.noreply.github.com> * Added Jacobi Iteration Method Added this method in arithmetic_analysis folder. This method is used to solve system of linear equations. * Added comments * Added reference link * Update jacobi_iteration_method.py * Changes for codespell test * Update jacobi_iteration_method.py * Update jacobi_iteration_method.py * Update arithmetic_analysis/jacobi_iteration_method.py Co-authored-by: Christian Clauss <cclauss@me.com> * updating DIRECTORY.md * Update arithmetic_analysis/jacobi_iteration_method.py Co-authored-by: Christian Clauss <cclauss@me.com> * Update arithmetic_analysis/jacobi_iteration_method.py Co-authored-by: Christian Clauss <cclauss@me.com> * Update arithmetic_analysis/jacobi_iteration_method.py Co-authored-by: Christian Clauss <cclauss@me.com> * Update arithmetic_analysis/jacobi_iteration_method.py Co-authored-by: Christian Clauss <cclauss@me.com> * Update arithmetic_analysis/jacobi_iteration_method.py Co-authored-by: Christian Clauss <cclauss@me.com> * Update arithmetic_analysis/jacobi_iteration_method.py Co-authored-by: Christian Clauss <cclauss@me.com> * Update jacobi_iteration_method.py * Update jacobi_iteration_method.py * Update jacobi_iteration_method.py * fix styles Co-authored-by: Christian Clauss <cclauss@me.com> Co-authored-by: github-actions <${GITHUB_ACTOR}@users.noreply.github.com> Co-authored-by: John Law <johnlaw.po@gmail.com> * Update ternary_search.py * Update mypy.ini * Update simulated_annealing.py * Update ternary_search.py * formatting * formatting * Update matrix_operation.py * Update matrix_operation.py * Update matrix_operation.py
* Added solution for Project Euler problem 145 * Updated spelling of comments Updated spelling inline with codespell * Removed trailing whitespaces in comments * Added default values. * nr -> number Co-authored-by: John Law <johnlaw.po@gmail.com> * nr -> number * Update sol1.py * Update sol1.py Co-authored-by: John Law <johnlaw.po@gmail.com>
* Update matrix_operation.py * Update mypy.ini * Update DIRECTORY.md * formatting * Update matrix_operation.py * doctest for exception * A bit more...
* Adds repr and doctest of current behavior linkedlist in other/lru_cache * Blocks removal of head or tail of double linked list * clarifies add() logic for double linked list in other/lru_cache * expands doctests to compare cache and lru cache * [mypy] annotates vars for other/lru_cache * [mypy] Annotates lru_cache decorator for other/lru_cache * Higher order functions require a verbose Callable annotation * [mypy] Makes LRU_Cache generic over key and value types for other/lru_cache + no reason to force int -> int * [mypy] makes decorator a classmethod for access to class generic types * breaks two long lines in doctest for other/lru_cache * simplifies boundary test remove() for other/lru_cache * [mypy] Annotates, adds doctests, and makes Generic other/lfu_cache See also commits to other/lru_cache which guided these * [mypy] annotates cls var in other/lfu_cache * cleans up items from code review for lfu_cache and lru_cache * [mypy] runs mypy on lfu_cache and lru_cache
* add 5 README files * empty commit to (hopefully) get rid of the `test-are-failling` label * Update ciphers/README.md Co-authored-by: John Law <johnlaw.po@gmail.com> * Update conversions/README.md Co-authored-by: John Law <johnlaw.po@gmail.com> * Update cellular_automata/README.md Co-authored-by: John Law <johnlaw.po@gmail.com> * Update computer_vision/README.md Co-authored-by: John Law <johnlaw.po@gmail.com> * Update conversions/README.md Co-authored-by: John Law <johnlaw.po@gmail.com> * Update compression/README.md Co-authored-by: John Law <johnlaw.po@gmail.com>
* Created new persistence algorithm * Update persistence.py * Added another persistence function
* makes LRUCache constructor concrete * fixes bug in dq_removal in other/least_recently_used + deque.remove() operates by value not index * [mypy] Annotates other/least_recently_used over generic type + clean-up: rename key_reference to match type. * [mypy] updates example to demonstrate LRUCache with complex type * Adds doctest to other/least_recently_used * mypy.ini: Remove exclude = (other/least_recently_used.py) * Various mypy configs * Delete mypy.ini * Add mypy to .pre-commit-config.yaml * mypy --ignore-missing-imports --install-types --non-interactive . * mypy v0.910 * Pillow=8.3.7 * Pillow==8.3.7 * Pillow==8.3.2 * Update .pre-commit-config.yaml * Update requirements.txt * Update pre-commit.yml * --install-types # See mirrors-mypy README.md Co-authored-by: Christian Clauss <cclauss@me.com>
* adding pooling algorithms * pooling.py: Adding pooling algorithms to computer vision pull_number= * pooling.py: Adding pooling algorithms to computer vision * pooling_functions.py: Adding pooling algorithms to computer vision * pooling.py: Adding Pooling Algorithms * pooling_functions.py Add and Update * Update pooling_functions.py * Update computer_vision/pooling_functions.py Co-authored-by: Christian Clauss <cclauss@me.com> * Update computer_vision/pooling_functions.py Co-authored-by: Christian Clauss <cclauss@me.com> * Update computer_vision/pooling_functions.py Co-authored-by: Christian Clauss <cclauss@me.com> * Update computer_vision/pooling_functions.py Co-authored-by: Christian Clauss <cclauss@me.com> * Update pooling_functions.py * Formatting pooling.py Co-authored-by: Christian Clauss <cclauss@me.com>
* Replace typing.optional with new annotations syntax * updating DIRECTORY.md Co-authored-by: github-actions <${GITHUB_ACTOR}@users.noreply.github.com> * Updated the comments in the code * Update .gitignore * Update .gitignore * Update .gitignore Co-authored-by: Christian Clauss <cclauss@me.com>
* Added memoization function in fibonacci * Minor changes
* Update merge_insertion_sort.py Fixes #5774 merge_insertion_sort Co-Authored-By: AilisOsswald <44617437+AilisOsswald@users.noreply.github.com> * Update merge_insertion_sort.py Fixes #5774 merge_insertion_sort Co-Authored-By: AilisOsswald <44617437+AilisOsswald@users.noreply.github.com> * Update merge_insertion_sort.py Fixes #5774 added permutation range from 0 to 4 Co-Authored-By: AilisOsswald <44617437+AilisOsswald@users.noreply.github.com> * Use `all()` Co-authored-by: AilisOsswald <44617437+AilisOsswald@users.noreply.github.com> Co-authored-by: John Law <johnlaw.po@gmail.com>
* Syntax improvements (I hope) to boolean algebra * Reverted certain index variables to i * remove extra line on decimal_to_binary * Update quine_mc_cluskey.py Co-authored-by: John Law <johnlaw.po@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Add this suggestion to a batch that can be applied as a single commit. This suggestion is invalid because no changes were made to the code. Suggestions cannot be applied while the pull request is closed. Suggestions cannot be applied while viewing a subset of changes. Only one suggestion per line can be applied in a batch. Add this suggestion to a batch that can be applied as a single commit. Applying suggestions on deleted lines is not supported. You must change the existing code in this line in order to create a valid suggestion. Outdated suggestions cannot be applied. This suggestion has been applied or marked resolved. Suggestions cannot be applied from pending reviews. Suggestions cannot be applied on multi-line comments. Suggestions cannot be applied while the pull request is queued to merge. Suggestion cannot be applied right now. Please check back later.
See Commits and Changes for more details.
Created by
pull[bot]
Can you help keep this open source service alive? 💖 Please sponsor : )