{"id":13396900,"url":"https://github.com/keon/algorithms","last_synced_at":"2025-05-13T15:08:46.653Z","repository":{"id":37382054,"uuid":"74073233","full_name":"keon/algorithms","owner":"keon","description":"Minimal examples of data structures and algorithms in Python","archived":false,"fork":false,"pushed_at":"2024-07-14T17:48:07.000Z","size":1468,"stargazers_count":24460,"open_issues_count":221,"forks_count":4661,"subscribers_count":636,"default_branch":"master","last_synced_at":"2025-04-22T11:42:02.724Z","etag":null,"topics":["algorithm","algorithms","competitive-programming","data-structure","graph","python","search","sort","tree"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/keon.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2016-11-17T22:32:08.000Z","updated_at":"2025-04-22T08:57:22.000Z","dependencies_parsed_at":"2023-12-01T18:47:01.316Z","dependency_job_id":"23770633-4c5d-459a-a6fc-7b0c46d4488e","html_url":"https://github.com/keon/algorithms","commit_stats":{"total_commits":758,"total_committers":201,"mean_commits":3.771144278606965,"dds":0.9129287598944591,"last_synced_commit":"a336ee8f6595ad0ef14de6acbae765b36af7c5ba"},"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/keon%2Falgorithms","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/keon%2Falgorithms/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/keon%2Falgorithms/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/keon%2Falgorithms/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/keon","download_url":"https://codeload.github.com/keon/algorithms/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252577020,"owners_count":21770721,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["algorithm","algorithms","competitive-programming","data-structure","graph","python","search","sort","tree"],"created_at":"2024-07-30T18:01:07.127Z","updated_at":"2025-05-05T21:10:45.481Z","avatar_url":"https://github.com/keon.png","language":"Python","readme":"[![PyPI version](https://badge.fury.io/py/algorithms.svg)](https://badge.fury.io/py/algorithms)\n[![Open Source Helpers](https://www.codetriage.com/keon/algorithms/badges/users.svg)](https://www.codetriage.com/keon/algorithms)\n[![Build Status](https://travis-ci.org/keon/algorithms.svg?branch=master)](https://travis-ci.org/keon/algorithms)\n[![Coverage Status](https://coveralls.io/repos/github/keon/algorithms/badge.svg?branch=master)](https://coveralls.io/github/keon/algorithms?branch=master)\n\n\u003cp align=\"center\"\u003e\u003cimg src=\"https://raw.githubusercontent.com/keon/algorithms/master/docs/source/_static/logo/logotype1blue.png\"\u003e\u003c/p\u003e\n\nPythonic Data Structures and Algorithms\n=========================================\n\nMinimal and clean example implementations of data structures and algorithms in Python 3.\n\n## Contributing\nThanks for your interest in contributing! There are many ways to contribute to this project. [Get started here](CONTRIBUTING.md)\n\n## Tests\n\n### Use unittest\nFor running all tests write down:\n\n    $ python3 -m unittest discover tests\n\nFor running some specific tests you can do this as following (Ex: sort):\n\n    $ python3 -m unittest tests.test_sort\n\n### Use pytest\nFor running all tests write down:\n\n    $ python3 -m pytest tests\n\n## Install\nIf you want to use the API algorithms in your code, it is as simple as:\n\n    $ pip3 install algorithms\n\nYou can test by creating a python file: (Ex: use `merge_sort` in `sort`)\n\n```python3\nfrom algorithms.sort import merge_sort\n\nif __name__ == \"__main__\":\n    my_list = [1, 8, 3, 5, 6]\n    my_list = merge_sort(my_list)\n    print(my_list)\n```\n\n## Uninstall\nIf you want to uninstall algorithms, it is as simple as:\n\n    $ pip3 uninstall -y algorithms\n\n## List of Implementations\n\n- [arrays](algorithms/arrays)\n    - [delete_nth](algorithms/arrays/delete_nth.py)\n    - [flatten](algorithms/arrays/flatten.py)\n    - [garage](algorithms/arrays/garage.py)\n    - [josephus_problem](algorithms/arrays/josephus.py)\n    - [limit](algorithms/arrays/limit.py)\n    - [longest_non_repeat](algorithms/arrays/longest_non_repeat.py/)\n    - [max_ones_index](algorithms/arrays/max_ones_index.py)\n    - [merge_intervals](algorithms/arrays/merge_intervals.py)\n    - [missing_ranges](algorithms/arrays/missing_ranges.py)\n    - [plus_one](algorithms/arrays/plus_one.py)\n    - [remove_duplicates](algorithms/arrays/remove_duplicates.py)\n    - [rotate](algorithms/arrays/rotate.py)\n    - [summarize_ranges](algorithms/arrays/summarize_ranges.py)\n    - [three_sum](algorithms/arrays/three_sum.py)\n    - [trimmean](algorithms/arrays/trimmean.py)\n    - [top_1](algorithms/arrays/top_1.py)\n    - [two_sum](algorithms/arrays/two_sum.py)\n    - [move_zeros](algorithms/arrays/move_zeros.py)\n    - [n_sum](algorithms/arrays/n_sum.py)\n- [greedy](algorithms/greedy/)\n    - [max_contiguous_subsequence_sum](algorithms/greedy/max_contiguous_subsequence_sum.py)\n- [automata](algorithms/automata)\n    - [DFA](algorithms/automata/dfa.py)\n- [backtrack](algorithms/backtrack)\n    - [general_solution.md](algorithms/backtrack/)\n    - [add_operators](algorithms/backtrack/add_operators.py)\n    - [anagram](algorithms/backtrack/anagram.py)\n    - [array_sum_combinations](algorithms/backtrack/array_sum_combinations.py)\n    - [combination_sum](algorithms/backtrack/combination_sum.py)\n    - [factor_combinations](algorithms/backtrack/factor_combinations.py)\n    - [generate_abbreviations](algorithms/backtrack/generate_abbreviations.py)\n    - [generate_parenthesis](algorithms/backtrack/generate_parenthesis.py)\n    - [letter_combination](algorithms/backtrack/letter_combination.py)\n    - [palindrome_partitioning](algorithms/backtrack/palindrome_partitioning.py)\n    - [pattern_match](algorithms/backtrack/pattern_match.py)\n    - [permute](algorithms/backtrack/permute.py)\n    - [permute_unique](algorithms/backtrack/permute_unique.py)\n    - [subsets](algorithms/backtrack/subsets.py)\n    - [subsets_unique](algorithms/backtrack/subsets_unique.py)\n- [bfs](algorithms/bfs)\n    - [maze_search](algorithms/bfs/maze_search.py)\n    - [shortest_distance_from_all_buildings](algorithms/bfs/shortest_distance_from_all_buildings.py)\n    - [word_ladder](algorithms/bfs/word_ladder.py)\n- [bit](algorithms/bit)\n    - [add_bitwise_operator](algorithms/bit/add_bitwise_operator.py)\n    - [bit_operation](algorithms/bit/bit_operation.py)\n    - [bytes_int_conversion](algorithms/bit/bytes_int_conversion.py)\n    - [count_flips_to_convert](algorithms/bit/count_flips_to_convert.py)\n    - [count_ones](algorithms/bit/count_ones.py)\n    - [find_difference](algorithms/bit/find_difference.py)\n    - [find_missing_number](algorithms/bit/find_missing_number.py)\n    - [flip_bit_longest_sequence](algorithms/bit/flip_bit_longest_sequence.py)\n    - [power_of_two](algorithms/bit/power_of_two.py)\n    - [reverse_bits](algorithms/bit/reverse_bits.py)\n    - [single_number](algorithms/bit/single_number.py)\n    - [single_number2](algorithms/bit/single_number2.py)\n    - [single_number3](algorithms/bit/single_number3.py)\n    - [subsets](algorithms/bit/subsets.py)\n    - [swap_pair](algorithms/bit/swap_pair.py)\n    - [has_alternative_bit](algorithms/bit/has_alternative_bit.py)\n    - [insert_bit](algorithms/bit/insert_bit.py)\n    - [remove_bit](algorithms/bit/remove_bit.py)\n    - [binary_gap](algorithms/bit/binary_gap.py)\n- [compression](algorithms/compression)\n    - [huffman_coding](algorithms/compression/huffman_coding.py)\n    - [rle_compression](algorithms/compression/rle_compression.py)\n    - [elias](algorithms/compression/elias.py)\n- [dfs](algorithms/dfs)\n    - [all_factors](algorithms/dfs/all_factors.py)\n    - [count_islands](algorithms/dfs/count_islands.py)\n    - [pacific_atlantic](algorithms/dfs/pacific_atlantic.py)\n    - [sudoku_solver](algorithms/dfs/sudoku_solver.py)\n    - [walls_and_gates](algorithms/dfs/walls_and_gates.py)\n- [distribution](algorithms/distribution)\n    - [histogram](algorithms/distribution/histogram.py)\n- [dp](algorithms/dp)\n    - [buy_sell_stock](algorithms/dp/buy_sell_stock.py)\n    - [climbing_stairs](algorithms/dp/climbing_stairs.py)\n    - [coin_change](algorithms/dp/coin_change.py)\n    - [combination_sum](algorithms/dp/combination_sum.py)\n    - [egg_drop](algorithms/dp/egg_drop.py)\n    - [house_robber](algorithms/dp/house_robber.py)\n    - [int_divide](algorithms/dp/int_divide.py)\n    - [job_scheduling](algorithms/dp/job_scheduling.py)\n    - [knapsack](algorithms/dp/knapsack.py)\n    - [longest_increasing](algorithms/dp/longest_increasing.py)\n    - [matrix_chain_order](algorithms/dp/matrix_chain_order.py)\n    - [max_product_subarray](algorithms/dp/max_product_subarray.py)\n    - [max_subarray](algorithms/dp/max_subarray.py)\n    - [min_cost_path](algorithms/dp/min_cost_path.py)\n    - [num_decodings](algorithms/dp/num_decodings.py)\n    - [regex_matching](algorithms/dp/regex_matching.py)\n    - [rod_cut](algorithms/dp/rod_cut.py)\n    - [word_break](algorithms/dp/word_break.py)\n    - [fibonacci](algorithms/dp/fib.py)\n\t- [hosoya triangle](algorithms/dp/hosoya_triangle.py)\n\t- [K-Factor_strings](algorithms/dp/k_factor.py)\n    - [planting_trees](algorithms/dp/planting_trees.py)\n- [graph](algorithms/graph)\n    - [check_bipartite](algorithms/graph/check_bipartite.py)\n    - [strongly_connected](algorithms/graph/check_digraph_strongly_connected.py)\n    - [clone_graph](algorithms/graph/clone_graph.py)\n    - [cycle_detection](algorithms/graph/cycle_detection.py)\n    - [find_all_cliques](algorithms/graph/find_all_cliques.py)\n    - [find_path](algorithms/graph/find_path.py)\n    - [graph](algorithms/graph/graph.py)\n    - [dijkstra](algorithms/graph/dijkstra.py)\n    - [markov_chain](algorithms/graph/markov_chain.py)\n    - [minimum_spanning_tree](algorithms/graph/minimum_spanning_tree.py)\n    - [satisfiability](algorithms/graph/satisfiability.py)\n    - [minimum_spanning_tree_prims](algorithms/graph/prims_minimum_spanning.py)\n    - [tarjan](algorithms/graph/tarjan.py)\n    - [traversal](algorithms/graph/traversal.py)\n\t  - [maximum_flow](algorithms/graph/maximum_flow.py)\n    - [maximum_flow_bfs](algorithms/graph/maximum_flow_bfs.py)\n    - [maximum_flow_dfs](algorithms/graph/maximum_flow_dfs.py)\n    - [all_pairs_shortest_path](algorithms/graph/all_pairs_shortest_path.py)\n    - [bellman_ford](algorithms/graph/bellman_ford.py)\n    - [Count Connected Components](algorithms/graph/count_connected_number_of_component.py)\n- [heap](algorithms/heap)\n    - [merge_sorted_k_lists](algorithms/heap/merge_sorted_k_lists.py)\n    - [skyline](algorithms/heap/skyline.py)\n    - [sliding_window_max](algorithms/heap/sliding_window_max.py)\n    - [binary_heap](algorithms/heap/binary_heap.py)\n    - [k_closest_points](algorithms/heap/k_closest_points.py)\n- [linkedlist](algorithms/linkedlist)\n    - [add_two_numbers](algorithms/linkedlist/add_two_numbers.py)\n    - [copy_random_pointer](algorithms/linkedlist/copy_random_pointer.py)\n    - [delete_node](algorithms/linkedlist/delete_node.py)\n    - [first_cyclic_node](algorithms/linkedlist/first_cyclic_node.py)\n    - [is_cyclic](algorithms/linkedlist/is_cyclic.py)\n    - [is_palindrome](algorithms/linkedlist/is_palindrome.py)\n    - [kth_to_last](algorithms/linkedlist/kth_to_last.py)\n    - [linkedlist](algorithms/linkedlist/linkedlist.py)\n    - [remove_duplicates](algorithms/linkedlist/remove_duplicates.py)\n    - [reverse](algorithms/linkedlist/reverse.py)\n    - [rotate_list](algorithms/linkedlist/rotate_list.py)\n    - [swap_in_pairs](algorithms/linkedlist/swap_in_pairs.py)\n    - [is_sorted](algorithms/linkedlist/is_sorted.py)\n    - [remove_range](algorithms/linkedlist/remove_range.py)\n- [map](algorithms/map)\n    - [hashtable](algorithms/map/hashtable.py)\n    - [separate_chaining_hashtable](algorithms/map/separate_chaining_hashtable.py)\n    - [longest_common_subsequence](algorithms/map/longest_common_subsequence.py)\n    - [longest_palindromic_subsequence](algorithms/map/longest_palindromic_subsequence.py)\n    - [randomized_set](algorithms/map/randomized_set.py)\n    - [valid_sudoku](algorithms/map/valid_sudoku.py)\n    - [word_pattern](algorithms/map/word_pattern.py)\n    - [is_isomorphic](algorithms/map/is_isomorphic.py)\n    - [is_anagram](algorithms/map/is_anagram.py)\n- [maths](algorithms/maths)\n    - [base_conversion](algorithms/maths/base_conversion.py)\n    - [chinese_remainder_theorem](algorithms/maths/chinese_remainder_theorem.py)\n    - [combination](algorithms/maths/combination.py)\n    - [cosine_similarity](algorithms/maths/cosine_similarity.py)\n    - [decimal_to_binary_ip](algorithms/maths/decimal_to_binary_ip.py)\n    - [diffie_hellman_key_exchange](algorithms/maths/diffie_hellman_key_exchange.py)\n    - [euler_totient](algorithms/maths/euler_totient.py)\n    - [extended_gcd](algorithms/maths/extended_gcd.py)\n    - [factorial](algorithms/maths/factorial.py)\n    - [find_order](algorithms/maths/find_order_simple.py)\n    - [find_primitive_root](algorithms/maths/find_primitive_root_simple.py)\n    - [gcd/lcm](algorithms/maths/gcd.py)\n    - [generate_strobogrammtic](algorithms/maths/generate_strobogrammtic.py)\n    - [hailstone](algorithms/maths/hailstone.py)\n    - [is_strobogrammatic](algorithms/maths/is_strobogrammatic.py)\n    - [krishnamurthy_number](algorithms/maths/krishnamurthy_number.py)\n    - [magic_number](algorithms/maths/magic_number.py)\n    - [modular_exponential](algorithms/maths/modular_exponential.py)\n    - [modular_inverse](algorithms/maths/modular_inverse.py)\n    - [next_bigger](algorithms/maths/next_bigger.py)\n    - [next_perfect_square](algorithms/maths/next_perfect_square.py)\n    - [nth_digit](algorithms/maths/nth_digit.py)\n    - [num_perfect_squares](algorithms/maths/num_perfect_squares.py)\n    - [polynomial](algorithms/maths/polynomial.py)\n    - [power](algorithms/maths/power.py)\n    - [prime_check](algorithms/maths/prime_check.py)\n    - [primes_sieve_of_eratosthenes](algorithms/maths/primes_sieve_of_eratosthenes.py)\n    - [pythagoras](algorithms/maths/pythagoras.py)\n    - [rabin_miller](algorithms/maths/rabin_miller.py)\n    - [recursive_binomial_coefficient](algorithms/maths/recursive_binomial_coefficient.py)\n    - [rsa](algorithms/maths/rsa.py)\n    - [sqrt_precision_factor](algorithms/maths/sqrt_precision_factor.py)\n    - [summing_digits](algorithms/maths/summing_digits.py)\n    - [symmetry_group_cycle_index](algorithms/maths/symmetry_group_cycle_index.py)\n- [matrix](algorithms/matrix)\n    - [sudoku_validator](algorithms/matrix/sudoku_validator.py)\n    - [bomb_enemy](algorithms/matrix/bomb_enemy.py)\n    - [copy_transform](algorithms/matrix/copy_transform.py)\n    - [count_paths](algorithms/matrix/count_paths.py)\n    - [matrix_exponentiation](algorithms/matrix/matrix_exponentiation.py)\n    - [matrix_inversion](algorithms/matrix/matrix_inversion.py)\n    - [matrix_multiplication](algorithms/matrix/multiply.py)\n    - [rotate_image](algorithms/matrix/rotate_image.py)\n    - [search_in_sorted_matrix](algorithms/matrix/search_in_sorted_matrix.py)\n    - [sparse_dot_vector](algorithms/matrix/sparse_dot_vector.py)\n    - [sparse_mul](algorithms/matrix/sparse_mul.py)\n    - [spiral_traversal](algorithms/matrix/spiral_traversal.py)\n\t- [crout_matrix_decomposition](algorithms/matrix/crout_matrix_decomposition.py)\n\t- [cholesky_matrix_decomposition](algorithms/matrix/cholesky_matrix_decomposition.py)\n    - [sum_sub_squares](algorithms/matrix/sum_sub_squares.py)\n    - [sort_matrix_diagonally](algorithms/matrix/sort_matrix_diagonally.py)\n- [queues](algorithms/queues)\n    - [max_sliding_window](algorithms/queues/max_sliding_window.py)\n    - [moving_average](algorithms/queues/moving_average.py)\n    - [queue](algorithms/queues/queue.py)\n    - [reconstruct_queue](algorithms/queues/reconstruct_queue.py)\n    - [zigzagiterator](algorithms/queues/zigzagiterator.py)\n- [search](algorithms/search)\n    - [binary_search](algorithms/search/binary_search.py)\n    - [first_occurrence](algorithms/search/first_occurrence.py)\n    - [last_occurrence](algorithms/search/last_occurrence.py)\n    - [linear_search](algorithms/search/linear_search.py)\n    - [search_insert](algorithms/search/search_insert.py)\n    - [two_sum](algorithms/search/two_sum.py)\n    - [search_range](algorithms/search/search_range.py)\n    - [find_min_rotate](algorithms/search/find_min_rotate.py)\n    - [search_rotate](algorithms/search/search_rotate.py)\n    - [jump_search](algorithms/search/jump_search.py)\n    - [next_greatest_letter](algorithms/search/next_greatest_letter.py)\n    - [interpolation_search](algorithms/search/interpolation_search.py)\n- [set](algorithms/set)\n    - [randomized_set](algorithms/set/randomized_set.py)\n    - [set_covering](algorithms/set/set_covering.py)\n    - [find_keyboard_row](algorithms/set/find_keyboard_row.py)\n- [sort](algorithms/sort)\n    - [bitonic_sort](algorithms/sort/bitonic_sort.py)\n    - [bogo_sort](algorithms/sort/bogo_sort.py)\n    - [bubble_sort](algorithms/sort/bubble_sort.py)\n    - [bucket_sort](algorithms/sort/bucket_sort.py)\n    - [cocktail_shaker_sort](algorithms/sort/cocktail_shaker_sort.py)\n    - [comb_sort](algorithms/sort/comb_sort.py)\n    - [counting_sort](algorithms/sort/counting_sort.py)\n    - [cycle_sort](algorithms/sort/cycle_sort.py)\n    - [exchange_sort](algorithms/sort/exchange_sort.py)\n    - [gnome_sort](algorithms/sort/gnome_sort.py)\n    - [heap_sort](algorithms/sort/heap_sort.py)\n    - [insertion_sort](algorithms/sort/insertion_sort.py)\n    - [meeting_rooms](algorithms/sort/meeting_rooms.py)\n    - [merge_sort](algorithms/sort/merge_sort.py)\n    - [pancake_sort](algorithms/sort/pancake_sort.py)\n    - [pigeonhole_sort](algorithms/sort/pigeonhole_sort.py)\n    - [quick_sort](algorithms/sort/quick_sort.py)\n    - [radix_sort](algorithms/sort/radix_sort.py)\n    - [selection_sort](algorithms/sort/selection_sort.py)\n    - [shell_sort](algorithms/sort/shell_sort.py)\n    - [sort_colors](algorithms/sort/sort_colors.py)\n    - [stooge_sort](algorithms/sort/stooge_sort.py)\n    - [top_sort](algorithms/sort/top_sort.py)\n    - [wiggle_sort](algorithms/sort/wiggle_sort.py)\n- [stack](algorithms/stack)\n    - [longest_abs_path](algorithms/stack/longest_abs_path.py)\n    - [simplify_path](algorithms/stack/simplify_path.py)\n    - [stack](algorithms/stack/stack.py)\n    - [valid_parenthesis](algorithms/stack/valid_parenthesis.py)\n    - [stutter](algorithms/stack/stutter.py)\n    - [switch_pairs](algorithms/stack/switch_pairs.py)\n    - [is_consecutive](algorithms/stack/is_consecutive.py)\n    - [remove_min](algorithms/stack/remove_min.py)\n    - [is_sorted](algorithms/stack/is_sorted.py)\n- [streaming](algorithms/streaming)\n    - [1-sparse-recovery](algorithms/streaming/one_sparse_recovery.py)\n    - [misra-gries](algorithms/streaming/misra_gries.py)\n- [strings](algorithms/strings)\n    - [fizzbuzz](algorithms/strings/fizzbuzz.py)\n    - [delete_reoccurring](algorithms/strings/delete_reoccurring.py)\n    - [strip_url_params](algorithms/strings/strip_url_params.py)\n    - [validate_coordinates](algorithms/strings/validate_coordinates.py)\n    - [domain_extractor](algorithms/strings/domain_extractor.py)\n    - [merge_string_checker](algorithms/strings/merge_string_checker.py)\n    - [add_binary](algorithms/strings/add_binary.py)\n    - [breaking_bad](algorithms/strings/breaking_bad.py)\n    - [decode_string](algorithms/strings/decode_string.py)\n    - [encode_decode](algorithms/strings/encode_decode.py)\n    - [group_anagrams](algorithms/strings/group_anagrams.py)\n    - [int_to_roman](algorithms/strings/int_to_roman.py)\n    - [is_palindrome](algorithms/strings/is_palindrome.py)\n    - [license_number](algorithms/strings/license_number.py)\n    - [make_sentence](algorithms/strings/make_sentence.py)\n    - [multiply_strings](algorithms/strings/multiply_strings.py)\n    - [one_edit_distance](algorithms/strings/one_edit_distance.py)\n    - [rabin_karp](algorithms/strings/rabin_karp.py)\n    - [reverse_string](algorithms/strings/reverse_string.py)\n    - [reverse_vowel](algorithms/strings/reverse_vowel.py)\n    - [reverse_words](algorithms/strings/reverse_words.py)\n    - [roman_to_int](algorithms/strings/roman_to_int.py)\n    - [word_squares](algorithms/strings/word_squares.py)\n    - [unique_morse](algorithms/strings/unique_morse.py)\n    - [judge_circle](algorithms/strings/judge_circle.py)\n    - [strong_password](algorithms/strings/strong_password.py)\n    - [caesar_cipher](algorithms/strings/caesar_cipher.py)\n    - [check_pangram](algorithms/strings/check_pangram.py)\n    - [contain_string](algorithms/strings/contain_string.py)\n    - [count_binary_substring](algorithms/strings/count_binary_substring.py)\n    - [repeat_string](algorithms/strings/repeat_string.py)\n    - [min_distance](algorithms/strings/min_distance.py)\n    - [longest_common_prefix](algorithms/strings/longest_common_prefix.py)\n    - [rotate](algorithms/strings/rotate.py)\n    - [first_unique_char](algorithms/strings/first_unique_char.py)\n    - [repeat_substring](algorithms/strings/repeat_substring.py)\n\t  - [atbash_cipher](algorithms/strings/atbash_cipher.py)\n    - [longest_palindromic_substring](algorithms/strings/longest_palindromic_substring.py)\n  \t- [knuth_morris_pratt](algorithms/strings/knuth_morris_pratt.py)\n    - [panagram](algorithms/strings/panagram.py)\n- [tree](algorithms/tree)\n    - [bst](algorithms/tree/bst)\n        - [array_to_bst](algorithms/tree/bst/array_to_bst.py)\n        - [bst_closest_value](algorithms/tree/bst/bst_closest_value.py)\n        - [BSTIterator](algorithms/tree/bst/BSTIterator.py)\n        - [delete_node](algorithms/tree/bst/delete_node.py)\n        - [is_bst](algorithms/tree/bst/is_bst.py)\n        - [kth_smallest](algorithms/tree/bst/kth_smallest.py)\n        - [lowest_common_ancestor](algorithms/tree/bst/lowest_common_ancestor.py)\n        - [predecessor](algorithms/tree/bst/predecessor.py)\n        - [serialize_deserialize](algorithms/tree/bst/serialize_deserialize.py)\n        - [successor](algorithms/tree/bst/successor.py)\n        - [unique_bst](algorithms/tree/bst/unique_bst.py)\n        - [depth_sum](algorithms/tree/bst/depth_sum.py)\n        - [count_left_node](algorithms/tree/bst/count_left_node.py)\n        - [num_empty](algorithms/tree/bst/num_empty.py)\n        - [height](algorithms/tree/bst/height.py)\n\t- [fenwick_tree](algorithms/tree/fenwick_tree/fenwick_tree.py)\n    - [red_black_tree](algorithms/tree/red_black_tree)\n        - [red_black_tree](algorithms/tree/red_black_tree/red_black_tree.py)\n    - [segment_tree](algorithms/tree/segment_tree)\n        - [segment_tree](algorithms/tree/segment_tree/segment_tree.py)\n        - [iterative_segment_tree](algorithms/tree/segment_tree/iterative_segment_tree.py)\n    - [traversal](algorithms/tree/traversal)\n        - [inorder](algorithms/tree/traversal/inorder.py)\n        - [level_order](algorithms/tree/traversal/level_order.py)\n        - [postorder](algorithms/tree/traversal/postorder.py)\n        - [preorder](algorithms/tree/traversal/preorder.py)\n        - [zigzag](algorithms/tree/traversal/zigzag.py)\n    - [trie](algorithms/tree/trie)\n        - [add_and_search](algorithms/tree/trie/add_and_search.py)\n        - [trie](algorithms/tree/trie/trie.py)\n    - [b_tree](algorithms/tree/b_tree.py)\n    - [binary_tree_paths](algorithms/tree/binary_tree_paths.py)\n    - [bin_tree_to_list](algorithms/tree/bin_tree_to_list.py)\n    - [construct_tree_preorder_postorder](algorithms/tree/construct_tree_postorder_preorder.py)\n    - [deepest_left](algorithms/tree/deepest_left.py)\n    - [invert_tree](algorithms/tree/invert_tree.py)\n    - [is_balanced](algorithms/tree/is_balanced.py)\n    - [is_subtree](algorithms/tree/is_subtree.py)\n    - [is_symmetric](algorithms/tree/is_symmetric.py)\n    - [longest_consecutive](algorithms/tree/longest_consecutive.py)\n    - [lowest_common_ancestor](algorithms/tree/lowest_common_ancestor.py)\n    - [max_height](algorithms/tree/max_height.py)\n    - [max_path_sum](algorithms/tree/max_path_sum.py)\n    - [min_height](algorithms/tree/min_height.py)\n    - [path_sum](algorithms/tree/path_sum.py)\n    - [path_sum2](algorithms/tree/path_sum2.py)\n    - [pretty_print](algorithms/tree/pretty_print.py)\n    - [same_tree](algorithms/tree/same_tree.py)\n    - [tree](algorithms/tree/tree.py)\n- [unix](algorithms/unix)\n    - [path](algorithms/unix/path/)\n        - [join_with_slash](algorithms/unix/path/join_with_slash.py)\n        - [full_path](algorithms/unix/path/full_path.py)\n        - [split](algorithms/unix/path/split.py)\n        - [simplify_path](algorithms/unix/path/simplify_path.py)\n- [unionfind](algorithms/unionfind)\n    - [count_islands](algorithms/unionfind/count_islands.py)\n\n\n## Contributors\n\nThanks to [all the contributors](https://github.com/keon/algorithms/graphs/contributors)\nwho helped in building the repo.\n","funding_links":[],"categories":["Algorithms and Design Patterns","Python","算法","Data structures and Algorithms","机器学习","Containers \u0026 Language Extentions \u0026 Linting","Uncategorized","Python (1887)","学习资源","Algorithms and Design Patterns [🔝](#readme)","算法和设计模式","algorithms","Algorithms \u0026 Design Patterns","参考和论坛","Computer Science","Github Libraries","资源列表","Awesome Python","General Programming","计算机基础"],"sub_categories":["Algorithms","算法相关","For Python","Uncategorized","Python资源","参考","算法和设计模式","Algorithms and Design Patterns","Parsers","py Algorithm"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkeon%2Falgorithms","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkeon%2Falgorithms","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkeon%2Falgorithms/lists"}