Branch: master
-
Numerous fixes to directed_and_undirected_(weighted)_graph.py (#2182)
* Numerous fixes to directed_and_undirected_(weighted)_graph.py * dict.keys() is almost never need in modern Python
Verified
This commit was created on GitHub.com and signed with a verified signature using GitHub’s key.GPG key ID: 4AEE18F83AFDEB23 Learn about signing commits -
isort --profile black . (#2181)
* updating DIRECTORY.md * isort --profile black . * Black after * updating DIRECTORY.md Co-authored-by: github-actions <${GITHUB_ACTOR}@users.noreply.github.com>
Verified
This commit was created on GitHub.com and signed with a verified signature using GitHub’s key.GPG key ID: 4AEE18F83AFDEB23 Learn about signing commits -
isort --profile black --recursive . (#2170)
* isort --profile black --recursive . * Update codespell.yml * typo: vertices * typo: Explanation * typo: Explanation * Fix typos
Verified
This commit was created on GitHub.com and signed with a verified signature using GitHub’s key.GPG key ID: 4AEE18F83AFDEB23 Learn about signing commits
-
Gale Shapley Algorithm (#2100)
* 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>
Verified
This commit was created on GitHub.com and signed with a verified signature using GitHub’s key.GPG key ID: 4AEE18F83AFDEB23 Learn about signing commits
-
double_linear_search algorithm (#2161)
* linear search iterating from both array sides * Update double_linear_search.py * Update double_linear_search.py * added doctests * updated doctests * Update double_linear_search.py * Update double_linear_search.py * added blank after >>> * made all the requested changes * Update double_linear_search.py * Update double_linear_search.py Co-authored-by: Christian Clauss <cclauss@me.com>
Verified
This commit was created on GitHub.com and signed with a verified signature using GitHub’s key.GPG key ID: 4AEE18F83AFDEB23 Learn about signing commits -
* black * Update matrix/matrix_operation.py Co-authored-by: Christian Clauss <cclauss@me.com> * Update matrix/matrix_operation.py Co-authored-by: Christian Clauss <cclauss@me.com> * Update matrix/matrix_operation.py Co-authored-by: Christian Clauss <cclauss@me.com> * Update matrix/matrix_operation.py Co-authored-by: Christian Clauss <cclauss@me.com> * flake8 error fix * Remove unreachable code * union Co-authored-by: Christian Clauss <cclauss@me.com>
Verified
This commit was created on GitHub.com and signed with a verified signature using GitHub’s key.GPG key ID: 4AEE18F83AFDEB23 Learn about signing commits
-
Update matrix_operation.py (#2159)
* Update matrix_operation.py * Update matrix_operation.py * Update matrix_operation.py * use yapf to format the code * recover the error check * add typing hint * Update matrix/matrix_operation.py Co-authored-by: Christian Clauss <cclauss@me.com> * Update matrix/matrix_operation.py Co-authored-by: Christian Clauss <cclauss@me.com> * Update matrix/matrix_operation.py Co-authored-by: Christian Clauss <cclauss@me.com> * Update matrix/matrix_operation.py Co-authored-by: Christian Clauss <cclauss@me.com> * add float doctest * black formated * Update searching_in_sorted_matrix.py * recover this file * f-string, typing hint , doctest * Update matrix_operation.py * Update searching_in_sorted_matrix.py * Update matrix_operation.py * Update matrix/matrix_operation.py Co-authored-by: Christian Clauss <cclauss@me.com> Co-authored-by: Christian Clauss <cclauss@me.com> Co-authored-by: vinayak <itssvinayak@gmail.com>
Verified
This commit was created on GitHub.com and signed with a verified signature using GitHub’s key.GPG key ID: 4AEE18F83AFDEB23 Learn about signing commits -
Rename shortest_job_first_algorithm.py to shortest_job_first.py (#2164)
* Rename shortest_job_first_algorithm.py to shortest_job_first.py * updating DIRECTORY.md * Minor tweek to round_robin.py Co-authored-by: github-actions <${GITHUB_ACTOR}@users.noreply.github.com>
Verified
This commit was created on GitHub.com and signed with a verified signature using GitHub’s key.GPG key ID: 4AEE18F83AFDEB23 Learn about signing commits -
Add round_robin scheduling algorithm (#2158)
* round_robin and priority cpu scheduling algorithms * Delete priority_cpu_scheduling.py * Delete round_robin_algorithm.py * [add] cpu_scheduling_algorithms * [add] Round robin cpu scheduling algorithm * Update scheduling/round_robin_scheduling_algorithm.py Co-authored-by: Christian Clauss <cclauss@me.com> * Update scheduling/round_robin.py Co-authored-by: Christian Clauss <cclauss@me.com> * Update scheduling/round_robin_scheduling.py Co-authored-by: Christian Clauss <cclauss@me.com> * Update scheduling/round_robin_scheduling.py Co-authored-by: Christian Clauss <cclauss@me.com> * Update scheduling/round_robin.py Co-authored-by: Christian Clauss <cclauss@me.com> * Round_Robin * Update round_robin.py * Update round_robin.py * Update round_robin.py * Update round_robin.py Co-authored-by: pawanbuddy <46370996+pawanbuddy@users.noreply.github.com> Co-authored-by: Christian Clauss <cclauss@me.com>
Verified
This commit was created on GitHub.com and signed with a verified signature using GitHub’s key.GPG key ID: 4AEE18F83AFDEB23 Learn about signing commits
-
black fixes and Travis CI fixes (#2160)
* 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>
Verified
This commit was created on GitHub.com and signed with a verified signature using GitHub’s key.GPG key ID: 4AEE18F83AFDEB23 Learn about signing commits -
Added minimum cost path algorithm (#2135)
* Added maximum path sum for matrix (top left to bottom right) * Changed maximum cost path to minimum cost path + added video explaination
Verified
This commit was created on GitHub.com and signed with a verified signature using GitHub’s key.GPG key ID: 4AEE18F83AFDEB23 Learn about signing commits
-
Only one carriage return (#2155)
* updating DIRECTORY.md * touch * fixup! Format Python code with psf/black push * Update word_frequency_functions.py * updating DIRECTORY.md * Update word_frequency_functions.py * Update lfu_cache.py * Update sol1.py Co-authored-by: github-actions <${GITHUB_ACTOR}@users.noreply.github.com>
Verified
This commit was created on GitHub.com and signed with a verified signature using GitHub’s key.GPG key ID: 4AEE18F83AFDEB23 Learn about signing commits -
Add url and typing hint for BFS (#2156)
* 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>
Verified
This commit was created on GitHub.com and signed with a verified signature using GitHub’s key.GPG key ID: 4AEE18F83AFDEB23 Learn about signing commits -
project_euler/problem_47/sol1.py (#2150)
* 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>
Verified
This commit was created on GitHub.com and signed with a verified signature using GitHub’s key.GPG key ID: 4AEE18F83AFDEB23 Learn about signing commits -
* Added LFU Cache * Update lfu_cache.py * None is returned * Add type hints Co-authored-by: Christian Clauss <cclauss@me.com>
Verified
This commit was created on GitHub.com and signed with a verified signature using GitHub’s key.GPG key ID: 4AEE18F83AFDEB23 Learn about signing commits -
* Added LRU Cache * Optimized the program * Added Cache as Decorator + Implemented suggestions * Implemented suggestions
Verified
This commit was created on GitHub.com and signed with a verified signature using GitHub’s key.GPG key ID: 4AEE18F83AFDEB23 Learn about signing commits -
NLP Word Frequency Algorithms (#2142)
* 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>
Verified
This commit was created on GitHub.com and signed with a verified signature using GitHub’s key.GPG key ID: 4AEE18F83AFDEB23 Learn about signing commits -
* Update avl_tree.py it's true definition of AVL tree,change left and right rotation,and add avl_tree doctest * Update avl_tree.py * Update data_structures/binary_tree/avl_tree.py Co-authored-by: Christian Clauss <cclauss@me.com> * Update data_structures/binary_tree/avl_tree.py Co-authored-by: Christian Clauss <cclauss@me.com> * Update data_structures/binary_tree/avl_tree.py Co-authored-by: Christian Clauss <cclauss@me.com> * Update data_structures/binary_tree/avl_tree.py Co-authored-by: Christian Clauss <cclauss@me.com> * Update data_structures/binary_tree/avl_tree.py Co-authored-by: Christian Clauss <cclauss@me.com> * Update data_structures/binary_tree/avl_tree.py Co-authored-by: Christian Clauss <cclauss@me.com> * Update data_structures/binary_tree/avl_tree.py Co-authored-by: Christian Clauss <cclauss@me.com> * Update data_structures/binary_tree/avl_tree.py Co-authored-by: Christian Clauss <cclauss@me.com> * Update data_structures/binary_tree/avl_tree.py Co-authored-by: Christian Clauss <cclauss@me.com> * Update data_structures/binary_tree/avl_tree.py Co-authored-by: Christian Clauss <cclauss@me.com> * Update data_structures/binary_tree/avl_tree.py Co-authored-by: Christian Clauss <cclauss@me.com> * Update avl_tree.py update some function name and update doctest * Update avl_tree.py change some code format to fit flake8 review Co-authored-by: Christian Clauss <cclauss@me.com>
Verified
This commit was created on GitHub.com and signed with a verified signature using GitHub’s key.GPG key ID: 4AEE18F83AFDEB23 Learn about signing commits -
Verified
This commit was created on GitHub.com and signed with a verified signature using GitHub’s key.GPG key ID: 4AEE18F83AFDEB23 Learn about signing commits -
Added doctests to OddEvenTraposition (#2152)
* Added doctests * Change __main__ content
Verified
This commit was created on GitHub.com and signed with a verified signature using GitHub’s key.GPG key ID: 4AEE18F83AFDEB23 Learn about signing commits
-
Add doctests to radix_sort() (#2148)
* Add doctests to radix_sort() * fixup! Format Python code with psf/black push * Update radix_sort.py * updating DIRECTORY.md Co-authored-by: github-actions <${GITHUB_ACTOR}@users.noreply.github.com>
Verified
This commit was created on GitHub.com and signed with a verified signature using GitHub’s key.GPG key ID: 4AEE18F83AFDEB23 Learn about signing commits -
* Added Markov Chain * Implemented suggestions
Verified
This commit was created on GitHub.com and signed with a verified signature using GitHub’s key.GPG key ID: 4AEE18F83AFDEB23 Learn about signing commits
-
hamming_code.py: Reduce McCabe code complexity (#2140)
* hamming_code.py: Reduce McCabe code complexity As discussed in #2128 * fixup! Format Python code with psf/black push Co-authored-by: github-actions <${GITHUB_ACTOR}@users.noreply.github.com>
Verified
This commit was created on GitHub.com and signed with a verified signature using GitHub’s key.GPG key ID: 4AEE18F83AFDEB23 Learn about signing commits -
Euler problem 551 sol 1: Reduce McCabe code complexity (#2141)
* Euler problem 551 sol 1: Reduce McCabe code complexity As discussed in #2128 * fixup! Format Python code with psf/black push Co-authored-by: github-actions <${GITHUB_ACTOR}@users.noreply.github.com>
Verified
This commit was created on GitHub.com and signed with a verified signature using GitHub’s key.GPG key ID: 4AEE18F83AFDEB23 Learn about signing commits
-
add visualization of k means clustering as excel format (#2104)
* add visualization of kmneas clust as excel format * style changes * style changes * Add doctest and typehint! * style change * Update machine_learning/k_means_clust.py Co-authored-by: Christian Clauss <cclauss@me.com> * Update machine_learning/k_means_clust.py Co-authored-by: Christian Clauss <cclauss@me.com> Co-authored-by: Christian Clauss <cclauss@me.com>
Verified
This commit was created on GitHub.com and signed with a verified signature using GitHub’s key.GPG key ID: 4AEE18F83AFDEB23 Learn about signing commits
-
Added (Open) Knight Tour Algorithm (#2132)
* Added (Open) Knight Tour Algorithm * Implemented Suggestions
Verified
This commit was created on GitHub.com and signed with a verified signature using GitHub’s key.GPG key ID: 4AEE18F83AFDEB23 Learn about signing commits
-
Add lempel ziv compression (#2107)
* Added lempel-ziv compression algorithm implementation * Added lempel-ziv decompression algorithm implementation * Reformatted lempel-ziv compress/decompress files using black * Added type hints and some other modifications (Doctests coming up) * Shortened several lines to comply with the standards
Verified
This commit was created on GitHub.com and signed with a verified signature using GitHub’s key.GPG key ID: 4AEE18F83AFDEB23 Learn about signing commits -
Implement prefix function, knuth-morris-pratt another usage (#2099)
* Implement prefix function, knuth-morris-pratt another usage * fixup! Format Python code with psf/black push * Fix style * updating DIRECTORY.md * Update prefix_function.py Co-authored-by: github-actions <${GITHUB_ACTOR}@users.noreply.github.com> Co-authored-by: Christian Clauss <cclauss@me.com>
Verified
This commit was created on GitHub.com and signed with a verified signature using GitHub’s key.GPG key ID: 4AEE18F83AFDEB23 Learn about signing commits -
Strongly connected components (#2114)
* Implement strongly connected components for graph algorithms * fixup! Format Python code with psf/black push * Delete trailing whitespace * updating DIRECTORY.md * Add doctests and typehints * Remove unnecessary comments, change variable names * fixup! Format Python code with psf/black push * Change undefined variable's name * Apply suggestions from code review Co-authored-by: Christian Clauss <cclauss@me.com> Co-authored-by: github-actions <${GITHUB_ACTOR}@users.noreply.github.com> Co-authored-by: Christian Clauss <cclauss@me.com>
Verified
This commit was created on GitHub.com and signed with a verified signature using GitHub’s key.GPG key ID: 4AEE18F83AFDEB23 Learn about signing commits -
Implement connected components algorithm for graphs (#2113)
* Implement connected components algorithm for graphs * fixup! Format Python code with psf/black push * Add parameters and return values annotations with Python type hints * updating DIRECTORY.md * Add doctests and typehints * Remove unnecessary comments, change variable names * fixup! Format Python code with psf/black push Co-authored-by: github-actions <${GITHUB_ACTOR}@users.noreply.github.com>
Verified
This commit was created on GitHub.com and signed with a verified signature using GitHub’s key.GPG key ID: 4AEE18F83AFDEB23 Learn about signing commits -
Added maximum non-adjacent sum (#2130)
* Added maximum non-adjacent sum * Bugfix: flake8 test * Implemented changes (broke tuple unpacking into 2 lines due to flake8 tests) * Implemented changes v2.0 * Update max_non_adjacent_sum.py Co-authored-by: Christian Clauss <cclauss@me.com>
Verified
This commit was created on GitHub.com and signed with a verified signature using GitHub’s key.GPG key ID: 4AEE18F83AFDEB23 Learn about signing commits -
Added doctests to bucket sort (#2079)
* Added doctests to bucket sort * Missing typehint * Wrap long lines * updating DIRECTORY.md * Update bucket_sort.py * updating DIRECTORY.md * Update bucket_sort.py Co-authored-by: Christian Clauss <cclauss@me.com> Co-authored-by: github-actions <${GITHUB_ACTOR}@users.noreply.github.com>
Verified
This commit was created on GitHub.com and signed with a verified signature using GitHub’s key.GPG key ID: 4AEE18F83AFDEB23 Learn about signing commits -
Create change_brightness.py (#2126)
* Create change_brightness.py * Update change_brightness.py * Update change_brightness.py * Update change_brightness.py * Update change_brightness.py Co-authored-by: Christian Clauss <cclauss@me.com>
Verified
This commit was created on GitHub.com and signed with a verified signature using GitHub’s key.GPG key ID: 4AEE18F83AFDEB23 Learn about signing commits
-
* Blacken Co-authored-by: github-actions <${GITHUB_ACTOR}@users.noreply.github.com>
Verified
This commit was created on GitHub.com and signed with a verified signature using GitHub’s key.GPG key ID: 4AEE18F83AFDEB23 Learn about signing commits -
* implement hash * fix flake8 error * Update hashes/djb2.py * Update hashes/djb2.py * Long lines * def djb2(s: str) -> int: Co-authored-by: Christian Clauss <cclauss@me.com>
Verified
This commit was created on GitHub.com and signed with a verified signature using GitHub’s key.GPG key ID: 4AEE18F83AFDEB23 Learn about signing commits