diff --git a/.github/workflows/README_Updater.yml b/.github/workflows/README_Updater.yml new file mode 100644 index 000000000..bd19005d1 --- /dev/null +++ b/.github/workflows/README_Updater.yml @@ -0,0 +1,25 @@ + +name: Python package + +on: + pull_request: + branches: [master] + types: [closed] + +jobs: + check-algorithms: + if: ${{ github.event.pull_request.merged }} # when doing a PR is merged + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v2 + - uses: actions/setup-python@v2 + - name: Update README.md + run: | # run scripts/update_functions_list.py + python3 scripts/update_functions_list.py + - name: Push README.md + run: | + git config --global user.email "kwk236@gmail.com" + git config --global user.name "Keon" + git commit -am "update README.md" || true + git push diff --git a/README.md b/README.md index 105c82505..cc190cc8c 100644 --- a/README.md +++ b/README.md @@ -51,369 +51,388 @@ If you want to uninstall algorithms, it is as simple as: $ pip3 uninstall -y algorithms ## List of Implementations - -- [arrays](algorithms/arrays) - - [delete_nth](algorithms/arrays/delete_nth.py) - - [flatten](algorithms/arrays/flatten.py) - - [garage](algorithms/arrays/garage.py) - - [josephus_problem](algorithms/arrays/josephus.py) - - [limit](algorithms/arrays/limit.py) - - [longest_non_repeat](algorithms/arrays/longest_non_repeat.py/) - - [max_ones_index](algorithms/arrays/max_ones_index.py) - - [merge_intervals](algorithms/arrays/merge_intervals.py) - - [missing_ranges](algorithms/arrays/missing_ranges.py) - - [plus_one](algorithms/arrays/plus_one.py) - - [rotate](algorithms/arrays/rotate.py) - - [summarize_ranges](algorithms/arrays/summarize_ranges.py) - - [three_sum](algorithms/arrays/three_sum.py) - - [trimmean](algorithms/arrays/trimmean.py) - - [top_1](algorithms/arrays/top_1.py) - - [two_sum](algorithms/arrays/two_sum.py) - - [move_zeros](algorithms/arrays/move_zeros.py) - - [n_sum](algorithms/arrays/n_sum.py) -- [automata](algorithms/automata) - - [DFA](algorithms/automata/dfa.py) -- [backtrack](algorithms/backtrack) - - [general_solution.md](algorithms/backtrack/) - - [add_operators](algorithms/backtrack/add_operators.py) - - [anagram](algorithms/backtrack/anagram.py) - - [array_sum_combinations](algorithms/backtrack/array_sum_combinations.py) - - [combination_sum](algorithms/backtrack/combination_sum.py) - - [factor_combinations](algorithms/backtrack/factor_combinations.py) - - [generate_abbreviations](algorithms/backtrack/generate_abbreviations.py) - - [generate_parenthesis](algorithms/backtrack/generate_parenthesis.py) - - [letter_combination](algorithms/backtrack/letter_combination.py) - - [palindrome_partitioning](algorithms/backtrack/palindrome_partitioning.py) - - [pattern_match](algorithms/backtrack/pattern_match.py) - - [permute](algorithms/backtrack/permute.py) - - [permute_unique](algorithms/backtrack/permute_unique.py) - - [subsets](algorithms/backtrack/subsets.py) - - [subsets_unique](algorithms/backtrack/subsets_unique.py) -- [bfs](algorithms/bfs) - - [maze_search](algorithms/bfs/maze_search.py) - - [shortest_distance_from_all_buildings](algorithms/bfs/shortest_distance_from_all_buildings.py) - - [word_ladder](algorithms/bfs/word_ladder.py) -- [bit](algorithms/bit) - - [add_bitwise_operator](algorithms/bit/add_bitwise_operator.py) - - [bit_operation](algorithms/bit/bit_operation.py) - - [bytes_int_conversion](algorithms/bit/bytes_int_conversion.py) - - [count_flips_to_convert](algorithms/bit/count_flips_to_convert.py) - - [count_ones](algorithms/bit/count_ones.py) - - [find_difference](algorithms/bit/find_difference.py) - - [find_missing_number](algorithms/bit/find_missing_number.py) - - [flip_bit_longest_sequence](algorithms/bit/flip_bit_longest_sequence.py) - - [power_of_two](algorithms/bit/power_of_two.py) - - [reverse_bits](algorithms/bit/reverse_bits.py) - - [single_number](algorithms/bit/single_number.py) - - [single_number2](algorithms/bit/single_number2.py) - - [single_number3](algorithms/bit/single_number3.py) - - [subsets](algorithms/bit/subsets.py) - - [swap_pair](algorithms/bit/swap_pair.py) - - [has_alternative_bit](algorithms/bit/has_alternative_bit.py) - - [insert_bit](algorithms/bit/insert_bit.py) - - [remove_bit](algorithms/bit/remove_bit.py) - - [binary_gap](algorithms/bit/binary_gap.py) -- [compression](algorithms/compression) - - [huffman_coding](algorithms/compression/huffman_coding.py) - - [rle_compression](algorithms/compression/rle_compression.py) - - [elias](algorithms/compression/elias.py) -- [dfs](algorithms/dfs) - - [all_factors](algorithms/dfs/all_factors.py) - - [count_islands](algorithms/dfs/count_islands.py) - - [pacific_atlantic](algorithms/dfs/pacific_atlantic.py) - - [sudoku_solver](algorithms/dfs/sudoku_solver.py) - - [walls_and_gates](algorithms/dfs/walls_and_gates.py) -- [distribution](algorithms/distribution) - - [histogram](algorithms/distribution/histogram.py) -- [dp](algorithms/dp) - - [buy_sell_stock](algorithms/dp/buy_sell_stock.py) - - [climbing_stairs](algorithms/dp/climbing_stairs.py) - - [coin_change](algorithms/dp/coin_change.py) - - [combination_sum](algorithms/dp/combination_sum.py) - - [egg_drop](algorithms/dp/egg_drop.py) - - [house_robber](algorithms/dp/house_robber.py) - - [int_divide](algorithms/dp/int_divide.py) - - [job_scheduling](algorithms/dp/job_scheduling.py) - - [knapsack](algorithms/dp/knapsack.py) - - [longest_increasing](algorithms/dp/longest_increasing.py) - - [matrix_chain_order](algorithms/dp/matrix_chain_order.py) - - [max_product_subarray](algorithms/dp/max_product_subarray.py) - - [max_subarray](algorithms/dp/max_subarray.py) - - [min_cost_path](algorithms/dp/min_cost_path.py) - - [num_decodings](algorithms/dp/num_decodings.py) - - [regex_matching](algorithms/dp/regex_matching.py) - - [rod_cut](algorithms/dp/rod_cut.py) - - [word_break](algorithms/dp/word_break.py) - - [fibonacci](algorithms/dp/fib.py) - - [hosoya triangle](algorithms/dp/hosoya_triangle.py) - - [K-Factor_strings](algorithms/dp/k_factor.py) - - [planting_trees](algorithms/dp/planting_trees.py) -- [graph](algorithms/graph) - - [check_bipartite](algorithms/graph/check_bipartite.py) - - [strongly_connected](algorithms/graph/check_digraph_strongly_connected.py) - - [clone_graph](algorithms/graph/clone_graph.py) - - [cycle_detection](algorithms/graph/cycle_detection.py) - - [find_all_cliques](algorithms/graph/find_all_cliques.py) - - [find_path](algorithms/graph/find_path.py) - - [graph](algorithms/graph/graph.py) - - [dijkstra](algorithms/graph/dijkstra.py) - - [markov_chain](algorithms/graph/markov_chain.py) - - [minimum_spanning_tree](algorithms/graph/minimum_spanning_tree.py) - - [satisfiability](algorithms/graph/satisfiability.py) - - [minimum_spanning_tree_prims](algorithms/graph/prims_minimum_spanning.py) - - [tarjan](algorithms/graph/tarjan.py) - - [traversal](algorithms/graph/traversal.py) - - [maximum_flow](algorithms/graph/maximum_flow.py) - - [maximum_flow_bfs](algorithms/graph/maximum_flow_bfs.py) - - [maximum_flow_dfs](algorithms/graph/maximum_flow_dfs.py) - - [all_pairs_shortest_path](algorithms/graph/all_pairs_shortest_path.py) - - [bellman_ford](algorithms/graph/bellman_ford.py) - - [Count Connected Components](algorithms/graph/count_connected_number_of_component.py) -- [heap](algorithms/heap) - - [merge_sorted_k_lists](algorithms/heap/merge_sorted_k_lists.py) - - [skyline](algorithms/heap/skyline.py) - - [sliding_window_max](algorithms/heap/sliding_window_max.py) - - [binary_heap](algorithms/heap/binary_heap.py) - - [k_closest_points](algorithms/heap/k_closest_points.py) -- [linkedlist](algorithms/linkedlist) - - [add_two_numbers](algorithms/linkedlist/add_two_numbers.py) - - [copy_random_pointer](algorithms/linkedlist/copy_random_pointer.py) - - [delete_node](algorithms/linkedlist/delete_node.py) - - [first_cyclic_node](algorithms/linkedlist/first_cyclic_node.py) - - [is_cyclic](algorithms/linkedlist/is_cyclic.py) - - [is_palindrome](algorithms/linkedlist/is_palindrome.py) - - [kth_to_last](algorithms/linkedlist/kth_to_last.py) - - [linkedlist](algorithms/linkedlist/linkedlist.py) - - [remove_duplicates](algorithms/linkedlist/remove_duplicates.py) - - [reverse](algorithms/linkedlist/reverse.py) - - [rotate_list](algorithms/linkedlist/rotate_list.py) - - [swap_in_pairs](algorithms/linkedlist/swap_in_pairs.py) - - [is_sorted](algorithms/linkedlist/is_sorted.py) - - [remove_range](algorithms/linkedlist/remove_range.py) -- [map](algorithms/map) - - [hashtable](algorithms/map/hashtable.py) - - [separate_chaining_hashtable](algorithms/map/separate_chaining_hashtable.py) - - [longest_common_subsequence](algorithms/map/longest_common_subsequence.py) - - [longest_palindromic_subsequence](algorithms/map/longest_palindromic_subsequence.py) - - [randomized_set](algorithms/map/randomized_set.py) - - [valid_sudoku](algorithms/map/valid_sudoku.py) - - [word_pattern](algorithms/map/word_pattern.py) - - [is_isomorphic](algorithms/map/is_isomorphic.py) - - [is_anagram](algorithms/map/is_anagram.py) -- [maths](algorithms/maths) - - [base_conversion](algorithms/maths/base_conversion.py) - - [chinese_remainder_theorem](algorithms/maths/chinese_remainder_theorem.py) - - [combination](algorithms/maths/combination.py) - - [cosine_similarity](algorithms/maths/cosine_similarity.py) - - [decimal_to_binary_ip](algorithms/maths/decimal_to_binary_ip.py) - - [diffie_hellman_key_exchange](algorithms/maths/diffie_hellman_key_exchange.py) - - [euler_totient](algorithms/maths/euler_totient.py) - - [extended_gcd](algorithms/maths/extended_gcd.py) - - [factorial](algorithms/maths/factorial.py) - - [find_order](algorithms/maths/find_order_simple.py) - - [find_primitive_root](algorithms/maths/find_primitive_root_simple.py) - - [gcd/lcm](algorithms/maths/gcd.py) - - [generate_strobogrammtic](algorithms/maths/generate_strobogrammtic.py) - - [hailstone](algorithms/maths/hailstone.py) - - [is_strobogrammatic](algorithms/maths/is_strobogrammatic.py) - - [krishnamurthy_number](algorithms/maths/krishnamurthy_number.py) - - [magic_number](algorithms/maths/magic_number.py) - - [modular_exponential](algorithms/maths/modular_exponential.py) - - [modular_inverse](algorithms/maths/modular_inverse.py) - - [next_bigger](algorithms/maths/next_bigger.py) - - [next_perfect_square](algorithms/maths/next_perfect_square.py) - - [nth_digit](algorithms/maths/nth_digit.py) - - [polynomial](algorithms/maths/polynomial.py) - - [power](algorithms/maths/power.py) - - [prime_check](algorithms/maths/prime_check.py) - - [primes_sieve_of_eratosthenes](algorithms/maths/primes_sieve_of_eratosthenes.py) - - [pythagoras](algorithms/maths/pythagoras.py) - - [rabin_miller](algorithms/maths/rabin_miller.py) - - [recursive_binomial_coefficient](algorithms/maths/recursive_binomial_coefficient.py) - - [rsa](algorithms/maths/rsa.py) - - [sqrt_precision_factor](algorithms/maths/sqrt_precision_factor.py) - - [summing_digits](algorithms/maths/summing_digits.py) - - [symmetry_group_cycle_index](algorithms/maths/symmetry_group_cycle_index.py) -- [matrix](algorithms/matrix) - - [sudoku_validator](algorithms/matrix/sudoku_validator.py) - - [bomb_enemy](algorithms/matrix/bomb_enemy.py) - - [copy_transform](algorithms/matrix/copy_transform.py) - - [count_paths](algorithms/matrix/count_paths.py) - - [matrix_exponentiation](algorithms/matrix/matrix_exponentiation.py) - - [matrix_inversion](algorithms/matrix/matrix_inversion.py) - - [matrix_multiplication](algorithms/matrix/multiply.py) - - [rotate_image](algorithms/matrix/rotate_image.py) - - [search_in_sorted_matrix](algorithms/matrix/search_in_sorted_matrix.py) - - [sparse_dot_vector](algorithms/matrix/sparse_dot_vector.py) - - [sparse_mul](algorithms/matrix/sparse_mul.py) - - [spiral_traversal](algorithms/matrix/spiral_traversal.py) - - [crout_matrix_decomposition](algorithms/matrix/crout_matrix_decomposition.py) - - [cholesky_matrix_decomposition](algorithms/matrix/cholesky_matrix_decomposition.py) - - [sum_sub_squares](algorithms/matrix/sum_sub_squares.py) - - [sort_matrix_diagonally](algorithms/matrix/sort_matrix_diagonally.py) -- [queues](algorithms/queues) - - [max_sliding_window](algorithms/queues/max_sliding_window.py) - - [moving_average](algorithms/queues/moving_average.py) - - [queue](algorithms/queues/queue.py) - - [reconstruct_queue](algorithms/queues/reconstruct_queue.py) - - [zigzagiterator](algorithms/queues/zigzagiterator.py) -- [search](algorithms/search) - - [binary_search](algorithms/search/binary_search.py) - - [first_occurrence](algorithms/search/first_occurrence.py) - - [last_occurrence](algorithms/search/last_occurrence.py) - - [linear_search](algorithms/search/linear_search.py) - - [search_insert](algorithms/search/search_insert.py) - - [two_sum](algorithms/search/two_sum.py) - - [search_range](algorithms/search/search_range.py) - - [find_min_rotate](algorithms/search/find_min_rotate.py) - - [search_rotate](algorithms/search/search_rotate.py) - - [jump_search](algorithms/search/jump_search.py) - - [next_greatest_letter](algorithms/search/next_greatest_letter.py) - - [interpolation_search](algorithms/search/interpolation_search.py) -- [set](algorithms/set) - - [randomized_set](algorithms/set/randomized_set.py) - - [set_covering](algorithms/set/set_covering.py) - - [find_keyboard_row](algorithms/set/find_keyboard_row.py) -- [sort](algorithms/sort) - - [bitonic_sort](algorithms/sort/bitonic_sort.py) - - [bogo_sort](algorithms/sort/bogo_sort.py) - - [bubble_sort](algorithms/sort/bubble_sort.py) - - [bucket_sort](algorithms/sort/bucket_sort.py) - - [cocktail_shaker_sort](algorithms/sort/cocktail_shaker_sort.py) - - [comb_sort](algorithms/sort/comb_sort.py) - - [counting_sort](algorithms/sort/counting_sort.py) - - [cycle_sort](algorithms/sort/cycle_sort.py) - - [gnome_sort](algorithms/sort/gnome_sort.py) - - [heap_sort](algorithms/sort/heap_sort.py) - - [insertion_sort](algorithms/sort/insertion_sort.py) - - [meeting_rooms](algorithms/sort/meeting_rooms.py) - - [merge_sort](algorithms/sort/merge_sort.py) - - [pancake_sort](algorithms/sort/pancake_sort.py) - - [pigeonhole_sort](algorithms/sort/pigeonhole_sort.py) - - [quick_sort](algorithms/sort/quick_sort.py) - - [radix_sort](algorithms/sort/radix_sort.py) - - [selection_sort](algorithms/sort/selection_sort.py) - - [shell_sort](algorithms/sort/shell_sort.py) - - [sort_colors](algorithms/sort/sort_colors.py) - - [stooge_sort](algorithms/sort/stooge_sort.py) - - [top_sort](algorithms/sort/top_sort.py) - - [wiggle_sort](algorithms/sort/wiggle_sort.py) -- [stack](algorithms/stack) - - [longest_abs_path](algorithms/stack/longest_abs_path.py) - - [simplify_path](algorithms/stack/simplify_path.py) - - [stack](algorithms/stack/stack.py) - - [valid_parenthesis](algorithms/stack/valid_parenthesis.py) - - [stutter](algorithms/stack/stutter.py) - - [switch_pairs](algorithms/stack/switch_pairs.py) - - [is_consecutive](algorithms/stack/is_consecutive.py) - - [remove_min](algorithms/stack/remove_min.py) - - [is_sorted](algorithms/stack/is_sorted.py) -- [streaming](algorithms/streaming) - - [1-sparse-recovery](algorithms/streaming/one_sparse_recovery.py) - - [misra-gries](algorithms/streaming/misra_gries.py) -- [strings](algorithms/strings) - - [fizzbuzz](algorithms/strings/fizzbuzz.py) - - [delete_reoccurring](algorithms/strings/delete_reoccurring.py) - - [strip_url_params](algorithms/strings/strip_url_params.py) - - [validate_coordinates](algorithms/strings/validate_coordinates.py) - - [domain_extractor](algorithms/strings/domain_extractor.py) - - [merge_string_checker](algorithms/strings/merge_string_checker.py) - - [add_binary](algorithms/strings/add_binary.py) - - [breaking_bad](algorithms/strings/breaking_bad.py) - - [decode_string](algorithms/strings/decode_string.py) - - [encode_decode](algorithms/strings/encode_decode.py) - - [group_anagrams](algorithms/strings/group_anagrams.py) - - [int_to_roman](algorithms/strings/int_to_roman.py) - - [is_palindrome](algorithms/strings/is_palindrome.py) - - [license_number](algorithms/strings/license_number.py) - - [make_sentence](algorithms/strings/make_sentence.py) - - [multiply_strings](algorithms/strings/multiply_strings.py) - - [one_edit_distance](algorithms/strings/one_edit_distance.py) - - [rabin_karp](algorithms/strings/rabin_karp.py) - - [reverse_string](algorithms/strings/reverse_string.py) - - [reverse_vowel](algorithms/strings/reverse_vowel.py) - - [reverse_words](algorithms/strings/reverse_words.py) - - [roman_to_int](algorithms/strings/roman_to_int.py) - - [word_squares](algorithms/strings/word_squares.py) - - [unique_morse](algorithms/strings/unique_morse.py) - - [judge_circle](algorithms/strings/judge_circle.py) - - [strong_password](algorithms/strings/strong_password.py) - - [caesar_cipher](algorithms/strings/caesar_cipher.py) - - [check_pangram](algorithms/strings/check_pangram.py) - - [contain_string](algorithms/strings/contain_string.py) - - [count_binary_substring](algorithms/strings/count_binary_substring.py) - - [repeat_string](algorithms/strings/repeat_string.py) - - [min_distance](algorithms/strings/min_distance.py) - - [longest_common_prefix](algorithms/strings/longest_common_prefix.py) - - [rotate](algorithms/strings/rotate.py) - - [first_unique_char](algorithms/strings/first_unique_char.py) - - [repeat_substring](algorithms/strings/repeat_substring.py) - - [atbash_cipher](algorithms/strings/atbash_cipher.py) - - [longest_palindromic_substring](algorithms/strings/longest_palindromic_substring.py) - - [knuth_morris_pratt](algorithms/strings/knuth_morris_pratt.py) - - [panagram](algorithms/strings/panagram.py) -- [tree](algorithms/tree) - - [bst](algorithms/tree/bst) - - [array_to_bst](algorithms/tree/bst/array_to_bst.py) - - [bst_closest_value](algorithms/tree/bst/bst_closest_value.py) - - [BSTIterator](algorithms/tree/bst/BSTIterator.py) - - [delete_node](algorithms/tree/bst/delete_node.py) - - [is_bst](algorithms/tree/bst/is_bst.py) - - [kth_smallest](algorithms/tree/bst/kth_smallest.py) - - [lowest_common_ancestor](algorithms/tree/bst/lowest_common_ancestor.py) - - [predecessor](algorithms/tree/bst/predecessor.py) - - [serialize_deserialize](algorithms/tree/bst/serialize_deserialize.py) - - [successor](algorithms/tree/bst/successor.py) - - [unique_bst](algorithms/tree/bst/unique_bst.py) - - [depth_sum](algorithms/tree/bst/depth_sum.py) - - [count_left_node](algorithms/tree/bst/count_left_node.py) - - [num_empty](algorithms/tree/bst/num_empty.py) - - [height](algorithms/tree/bst/height.py) - - [fenwick_tree](algorithms/tree/fenwick_tree] - - [fenwick_tree](algorithms/tree/fenwick_tree/fenwick_tree.py) - - [red_black_tree](algorithms/tree/red_black_tree) - - [red_black_tree](algorithms/tree/red_black_tree/red_black_tree.py) - - [segment_tree](algorithms/tree/segment_tree) - - [segment_tree](algorithms/tree/segment_tree/segment_tree.py) - - [iterative_segment_tree](algorithms/tree/segment_tree/iterative_segment_tree.py) - - [traversal](algorithms/tree/traversal) - - [inorder](algorithms/tree/traversal/inorder.py) - - [level_order](algorithms/tree/traversal/level_order.py) - - [postorder](algorithms/tree/traversal/postorder.py) - - [preorder](algorithms/tree/traversal/preorder.py) - - [zigzag](algorithms/tree/traversal/zigzag.py) - - [trie](algorithms/tree/trie) - - [add_and_search](algorithms/tree/trie/add_and_search.py) - - [trie](algorithms/tree/trie/trie.py) - - [b_tree](algorithms/tree/b_tree.py) - - [binary_tree_paths](algorithms/tree/binary_tree_paths.py) - - [bin_tree_to_list](algorithms/tree/bin_tree_to_list.py) - - [construct_tree_preorder_postorder](algorithms/tree/construct_tree_postorder_preorder.py) - - [deepest_left](algorithms/tree/deepest_left.py) - - [invert_tree](algorithms/tree/invert_tree.py) - - [is_balanced](algorithms/tree/is_balanced.py) - - [is_subtree](algorithms/tree/is_subtree.py) - - [is_symmetric](algorithms/tree/is_symmetric.py) - - [longest_consecutive](algorithms/tree/longest_consecutive.py) - - [lowest_common_ancestor](algorithms/tree/lowest_common_ancestor.py) - - [max_height](algorithms/tree/max_height.py) - - [max_path_sum](algorithms/tree/max_path_sum.py) - - [min_height](algorithms/tree/min_height.py) - - [path_sum](algorithms/tree/path_sum.py) - - [path_sum2](algorithms/tree/path_sum2.py) - - [pretty_print](algorithms/tree/pretty_print.py) - - [same_tree](algorithms/tree/same_tree.py) - - [tree](algorithms/tree/tree.py) -- [unix](algorithms/unix) - - [path](algorithms/unix/path/) - - [join_with_slash](algorithms/unix/path/join_with_slash.py) - - [full_path](algorithms/unix/path/full_path.py) - - [split](algorithms/unix/path/split.py) - - [simplify_path](algorithms/unix/path/simplify_path.py) -- [unionfind](algorithms/unionfind) - - [count_islands](algorithms/unionfind/count_islands.py) - - + + * [arrays](./algorithms/arrays) + * [delete_nth.py](./algorithms/arrays/delete_nth.py) + * [flatten.py](./algorithms/arrays/flatten.py) + * [garage.py](./algorithms/arrays/garage.py) + * [josephus.py](./algorithms/arrays/josephus.py) + * [limit.py](./algorithms/arrays/limit.py) + * [longest_non_repeat.py](./algorithms/arrays/longest_non_repeat.py) + * [max_ones_index.py](./algorithms/arrays/max_ones_index.py) + * [merge_intervals.py](./algorithms/arrays/merge_intervals.py) + * [missing_ranges.py](./algorithms/arrays/missing_ranges.py) + * [move_zeros.py](./algorithms/arrays/move_zeros.py) + * [n_sum.py](./algorithms/arrays/n_sum.py) + * [plus_one.py](./algorithms/arrays/plus_one.py) + * [rotate.py](./algorithms/arrays/rotate.py) + * [summarize_ranges.py](./algorithms/arrays/summarize_ranges.py) + * [three_sum.py](./algorithms/arrays/three_sum.py) + * [top_1.py](./algorithms/arrays/top_1.py) + * [trimmean.py](./algorithms/arrays/trimmean.py) + * [two_sum.py](./algorithms/arrays/two_sum.py) + * [automata](./algorithms/automata) + * [dfa.py](./algorithms/automata/dfa.py) + * [backtrack](./algorithms/backtrack) + * [add_operators.py](./algorithms/backtrack/add_operators.py) + * [anagram.py](./algorithms/backtrack/anagram.py) + * [array_sum_combinations.py](./algorithms/backtrack/array_sum_combinations.py) + * [combination_sum.py](./algorithms/backtrack/combination_sum.py) + * [factor_combinations.py](./algorithms/backtrack/factor_combinations.py) + * [find_words.py](./algorithms/backtrack/find_words.py) + * [generate_abbreviations.py](./algorithms/backtrack/generate_abbreviations.py) + * [generate_parenthesis.py](./algorithms/backtrack/generate_parenthesis.py) + * [letter_combination.py](./algorithms/backtrack/letter_combination.py) + * [palindrome_partitioning.py](./algorithms/backtrack/palindrome_partitioning.py) + * [pattern_match.py](./algorithms/backtrack/pattern_match.py) + * [permute.py](./algorithms/backtrack/permute.py) + * [permute_unique.py](./algorithms/backtrack/permute_unique.py) + * [subsets.py](./algorithms/backtrack/subsets.py) + * [subsets_unique.py](./algorithms/backtrack/subsets_unique.py) + * [bfs](./algorithms/bfs) + * [count_islands.py](./algorithms/bfs/count_islands.py) + * [maze_search.py](./algorithms/bfs/maze_search.py) + * [shortest_distance_from_all_buildings.py](./algorithms/bfs/shortest_distance_from_all_buildings.py) + * [word_ladder.py](./algorithms/bfs/word_ladder.py) + * [bit](./algorithms/bit) + * [add_bitwise_operator.py](./algorithms/bit/add_bitwise_operator.py) + * [binary_gap.py](./algorithms/bit/binary_gap.py) + * [bit_operation.py](./algorithms/bit/bit_operation.py) + * [bytes_int_conversion.py](./algorithms/bit/bytes_int_conversion.py) + * [count_flips_to_convert.py](./algorithms/bit/count_flips_to_convert.py) + * [count_ones.py](./algorithms/bit/count_ones.py) + * [find_difference.py](./algorithms/bit/find_difference.py) + * [find_missing_number.py](./algorithms/bit/find_missing_number.py) + * [flip_bit_longest_sequence.py](./algorithms/bit/flip_bit_longest_sequence.py) + * [has_alternative_bit.py](./algorithms/bit/has_alternative_bit.py) + * [insert_bit.py](./algorithms/bit/insert_bit.py) + * [power_of_two.py](./algorithms/bit/power_of_two.py) + * [remove_bit.py](./algorithms/bit/remove_bit.py) + * [reverse_bits.py](./algorithms/bit/reverse_bits.py) + * [single_number.py](./algorithms/bit/single_number.py) + * [single_number2.py](./algorithms/bit/single_number2.py) + * [single_number3.py](./algorithms/bit/single_number3.py) + * [subsets.py](./algorithms/bit/subsets.py) + * [swap_pair.py](./algorithms/bit/swap_pair.py) + * [compression](./algorithms/compression) + * [elias.py](./algorithms/compression/elias.py) + * [huffman_coding.py](./algorithms/compression/huffman_coding.py) + * [rle_compression.py](./algorithms/compression/rle_compression.py) + * [dfs](./algorithms/dfs) + * [all_factors.py](./algorithms/dfs/all_factors.py) + * [count_islands.py](./algorithms/dfs/count_islands.py) + * [maze_search.py](./algorithms/dfs/maze_search.py) + * [pacific_atlantic.py](./algorithms/dfs/pacific_atlantic.py) + * [sudoku_solver.py](./algorithms/dfs/sudoku_solver.py) + * [walls_and_gates.py](./algorithms/dfs/walls_and_gates.py) + * [distribution](./algorithms/distribution) + * [histogram.py](./algorithms/distribution/histogram.py) + * [dp](./algorithms/dp) + * [buy_sell_stock.py](./algorithms/dp/buy_sell_stock.py) + * [climbing_stairs.py](./algorithms/dp/climbing_stairs.py) + * [coin_change.py](./algorithms/dp/coin_change.py) + * [combination_sum.py](./algorithms/dp/combination_sum.py) + * [edit_distance.py](./algorithms/dp/edit_distance.py) + * [egg_drop.py](./algorithms/dp/egg_drop.py) + * [fib.py](./algorithms/dp/fib.py) + * [hosoya_triangle.py](./algorithms/dp/hosoya_triangle.py) + * [house_robber.py](./algorithms/dp/house_robber.py) + * [int_divide.py](./algorithms/dp/int_divide.py) + * [job_scheduling.py](./algorithms/dp/job_scheduling.py) + * [k_factor.py](./algorithms/dp/k_factor.py) + * [knapsack.py](./algorithms/dp/knapsack.py) + * [longest_common_subsequence.py](./algorithms/dp/longest_common_subsequence.py) + * [longest_increasing.py](./algorithms/dp/longest_increasing.py) + * [matrix_chain_order.py](./algorithms/dp/matrix_chain_order.py) + * [max_product_subarray.py](./algorithms/dp/max_product_subarray.py) + * [max_subarray.py](./algorithms/dp/max_subarray.py) + * [min_cost_path.py](./algorithms/dp/min_cost_path.py) + * [num_decodings.py](./algorithms/dp/num_decodings.py) + * [planting_trees.py](./algorithms/dp/planting_trees.py) + * [regex_matching.py](./algorithms/dp/regex_matching.py) + * [rod_cut.py](./algorithms/dp/rod_cut.py) + * [word_break.py](./algorithms/dp/word_break.py) + * [graph](./algorithms/graph) + * [all_pairs_shortest_path.py](./algorithms/graph/all_pairs_shortest_path.py) + * [bellman_ford.py](./algorithms/graph/bellman_ford.py) + * [check_bipartite.py](./algorithms/graph/check_bipartite.py) + * [check_digraph_strongly_connected.py](./algorithms/graph/check_digraph_strongly_connected.py) + * [clone_graph.py](./algorithms/graph/clone_graph.py) + * [count_connected_number_of_component.py](./algorithms/graph/count_connected_number_of_component.py) + * [cycle_detection.py](./algorithms/graph/cycle_detection.py) + * [dijkstra.py](./algorithms/graph/dijkstra.py) + * [find_all_cliques.py](./algorithms/graph/find_all_cliques.py) + * [find_path.py](./algorithms/graph/find_path.py) + * [graph.py](./algorithms/graph/graph.py) + * [markov_chain.py](./algorithms/graph/markov_chain.py) + * [maximum_flow.py](./algorithms/graph/maximum_flow.py) + * [maximum_flow_bfs.py](./algorithms/graph/maximum_flow_bfs.py) + * [maximum_flow_dfs.py](./algorithms/graph/maximum_flow_dfs.py) + * [minimum_spanning_tree.py](./algorithms/graph/minimum_spanning_tree.py) + * [path_between_two_vertices_in_digraph.py](./algorithms/graph/path_between_two_vertices_in_digraph.py) + * [prims_minimum_spanning.py](./algorithms/graph/prims_minimum_spanning.py) + * [satisfiability.py](./algorithms/graph/satisfiability.py) + * [tarjan.py](./algorithms/graph/tarjan.py) + * [transitive_closure_dfs.py](./algorithms/graph/transitive_closure_dfs.py) + * [traversal.py](./algorithms/graph/traversal.py) + * [heap](./algorithms/heap) + * [binary_heap.py](./algorithms/heap/binary_heap.py) + * [k_closest_points.py](./algorithms/heap/k_closest_points.py) + * [merge_sorted_k_lists.py](./algorithms/heap/merge_sorted_k_lists.py) + * [skyline.py](./algorithms/heap/skyline.py) + * [sliding_window_max.py](./algorithms/heap/sliding_window_max.py) + * [linkedlist](./algorithms/linkedlist) + * [add_two_numbers.py](./algorithms/linkedlist/add_two_numbers.py) + * [copy_random_pointer.py](./algorithms/linkedlist/copy_random_pointer.py) + * [delete_node.py](./algorithms/linkedlist/delete_node.py) + * [first_cyclic_node.py](./algorithms/linkedlist/first_cyclic_node.py) + * [intersection.py](./algorithms/linkedlist/intersection.py) + * [is_cyclic.py](./algorithms/linkedlist/is_cyclic.py) + * [is_palindrome.py](./algorithms/linkedlist/is_palindrome.py) + * [is_sorted.py](./algorithms/linkedlist/is_sorted.py) + * [kth_to_last.py](./algorithms/linkedlist/kth_to_last.py) + * [linkedlist.py](./algorithms/linkedlist/linkedlist.py) + * [merge_two_list.py](./algorithms/linkedlist/merge_two_list.py) + * [partition.py](./algorithms/linkedlist/partition.py) + * [remove_duplicates.py](./algorithms/linkedlist/remove_duplicates.py) + * [remove_range.py](./algorithms/linkedlist/remove_range.py) + * [reverse.py](./algorithms/linkedlist/reverse.py) + * [rotate_list.py](./algorithms/linkedlist/rotate_list.py) + * [swap_in_pairs.py](./algorithms/linkedlist/swap_in_pairs.py) + * [map](./algorithms/map) + * [hashtable.py](./algorithms/map/hashtable.py) + * [is_anagram.py](./algorithms/map/is_anagram.py) + * [is_isomorphic.py](./algorithms/map/is_isomorphic.py) + * [longest_common_subsequence.py](./algorithms/map/longest_common_subsequence.py) + * [longest_palindromic_subsequence.py](./algorithms/map/longest_palindromic_subsequence.py) + * [randomized_set.py](./algorithms/map/randomized_set.py) + * [separate_chaining_hashtable.py](./algorithms/map/separate_chaining_hashtable.py) + * [valid_sudoku.py](./algorithms/map/valid_sudoku.py) + * [word_pattern.py](./algorithms/map/word_pattern.py) + * [maths](./algorithms/maths) + * [base_conversion.py](./algorithms/maths/base_conversion.py) + * [chinese_remainder_theorem.py](./algorithms/maths/chinese_remainder_theorem.py) + * [combination.py](./algorithms/maths/combination.py) + * [cosine_similarity.py](./algorithms/maths/cosine_similarity.py) + * [decimal_to_binary_ip.py](./algorithms/maths/decimal_to_binary_ip.py) + * [diffie_hellman_key_exchange.py](./algorithms/maths/diffie_hellman_key_exchange.py) + * [euler_totient.py](./algorithms/maths/euler_totient.py) + * [extended_gcd.py](./algorithms/maths/extended_gcd.py) + * [factorial.py](./algorithms/maths/factorial.py) + * [find_order_simple.py](./algorithms/maths/find_order_simple.py) + * [find_primitive_root_simple.py](./algorithms/maths/find_primitive_root_simple.py) + * [gcd.py](./algorithms/maths/gcd.py) + * [generate_strobogrammtic.py](./algorithms/maths/generate_strobogrammtic.py) + * [hailstone.py](./algorithms/maths/hailstone.py) + * [is_strobogrammatic.py](./algorithms/maths/is_strobogrammatic.py) + * [krishnamurthy_number.py](./algorithms/maths/krishnamurthy_number.py) + * [magic_number.py](./algorithms/maths/magic_number.py) + * [modular_exponential.py](./algorithms/maths/modular_exponential.py) + * [modular_inverse.py](./algorithms/maths/modular_inverse.py) + * [next_bigger.py](./algorithms/maths/next_bigger.py) + * [next_perfect_square.py](./algorithms/maths/next_perfect_square.py) + * [nth_digit.py](./algorithms/maths/nth_digit.py) + * [num_digits.py](./algorithms/maths/num_digits.py) + * [polynomial.py](./algorithms/maths/polynomial.py) + * [power.py](./algorithms/maths/power.py) + * [prime_check.py](./algorithms/maths/prime_check.py) + * [primes_sieve_of_eratosthenes.py](./algorithms/maths/primes_sieve_of_eratosthenes.py) + * [pythagoras.py](./algorithms/maths/pythagoras.py) + * [rabin_miller.py](./algorithms/maths/rabin_miller.py) + * [recursive_binomial_coefficient.py](./algorithms/maths/recursive_binomial_coefficient.py) + * [rsa.py](./algorithms/maths/rsa.py) + * [sqrt_precision_factor.py](./algorithms/maths/sqrt_precision_factor.py) + * [summing_digits.py](./algorithms/maths/summing_digits.py) + * [symmetry_group_cycle_index.py](./algorithms/maths/symmetry_group_cycle_index.py) + * [matrix](./algorithms/matrix) + * [bomb_enemy.py](./algorithms/matrix/bomb_enemy.py) + * [cholesky_matrix_decomposition.py](./algorithms/matrix/cholesky_matrix_decomposition.py) + * [copy_transform.py](./algorithms/matrix/copy_transform.py) + * [count_paths.py](./algorithms/matrix/count_paths.py) + * [crout_matrix_decomposition.py](./algorithms/matrix/crout_matrix_decomposition.py) + * [matrix_exponentiation.py](./algorithms/matrix/matrix_exponentiation.py) + * [matrix_inversion.py](./algorithms/matrix/matrix_inversion.py) + * [multiply.py](./algorithms/matrix/multiply.py) + * [rotate_image.py](./algorithms/matrix/rotate_image.py) + * [search_in_sorted_matrix.py](./algorithms/matrix/search_in_sorted_matrix.py) + * [sort_matrix_diagonally.py](./algorithms/matrix/sort_matrix_diagonally.py) + * [sparse_dot_vector.py](./algorithms/matrix/sparse_dot_vector.py) + * [sparse_mul.py](./algorithms/matrix/sparse_mul.py) + * [spiral_traversal.py](./algorithms/matrix/spiral_traversal.py) + * [sudoku_validator.py](./algorithms/matrix/sudoku_validator.py) + * [sum_sub_squares.py](./algorithms/matrix/sum_sub_squares.py) + * [ml](./algorithms/ml) + * [nearest_neighbor.py](./algorithms/ml/nearest_neighbor.py) + * [queues](./algorithms/queues) + * [max_sliding_window.py](./algorithms/queues/max_sliding_window.py) + * [moving_average.py](./algorithms/queues/moving_average.py) + * [priority_queue.py](./algorithms/queues/priority_queue.py) + * [queue.py](./algorithms/queues/queue.py) + * [reconstruct_queue.py](./algorithms/queues/reconstruct_queue.py) + * [zigzagiterator.py](./algorithms/queues/zigzagiterator.py) + * [search](./algorithms/search) + * [binary_search.py](./algorithms/search/binary_search.py) + * [find_min_rotate.py](./algorithms/search/find_min_rotate.py) + * [first_occurrence.py](./algorithms/search/first_occurrence.py) + * [interpolation_search.py](./algorithms/search/interpolation_search.py) + * [jump_search.py](./algorithms/search/jump_search.py) + * [last_occurrence.py](./algorithms/search/last_occurrence.py) + * [linear_search.py](./algorithms/search/linear_search.py) + * [next_greatest_letter.py](./algorithms/search/next_greatest_letter.py) + * [search_insert.py](./algorithms/search/search_insert.py) + * [search_range.py](./algorithms/search/search_range.py) + * [search_rotate.py](./algorithms/search/search_rotate.py) + * [ternary_search.py](./algorithms/search/ternary_search.py) + * [two_sum.py](./algorithms/search/two_sum.py) + * [set](./algorithms/set) + * [find_keyboard_row.py](./algorithms/set/find_keyboard_row.py) + * [randomized_set.py](./algorithms/set/randomized_set.py) + * [set_covering.py](./algorithms/set/set_covering.py) + * [sort](./algorithms/sort) + * [bitonic_sort.py](./algorithms/sort/bitonic_sort.py) + * [bogo_sort.py](./algorithms/sort/bogo_sort.py) + * [bubble_sort.py](./algorithms/sort/bubble_sort.py) + * [bucket_sort.py](./algorithms/sort/bucket_sort.py) + * [cocktail_shaker_sort.py](./algorithms/sort/cocktail_shaker_sort.py) + * [comb_sort.py](./algorithms/sort/comb_sort.py) + * [counting_sort.py](./algorithms/sort/counting_sort.py) + * [cycle_sort.py](./algorithms/sort/cycle_sort.py) + * [gnome_sort.py](./algorithms/sort/gnome_sort.py) + * [heap_sort.py](./algorithms/sort/heap_sort.py) + * [insertion_sort.py](./algorithms/sort/insertion_sort.py) + * [meeting_rooms.py](./algorithms/sort/meeting_rooms.py) + * [merge_sort.py](./algorithms/sort/merge_sort.py) + * [pancake_sort.py](./algorithms/sort/pancake_sort.py) + * [pigeonhole_sort.py](./algorithms/sort/pigeonhole_sort.py) + * [quick_sort.py](./algorithms/sort/quick_sort.py) + * [radix_sort.py](./algorithms/sort/radix_sort.py) + * [selection_sort.py](./algorithms/sort/selection_sort.py) + * [shell_sort.py](./algorithms/sort/shell_sort.py) + * [sort_colors.py](./algorithms/sort/sort_colors.py) + * [stooge_sort.py](./algorithms/sort/stooge_sort.py) + * [top_sort.py](./algorithms/sort/top_sort.py) + * [wiggle_sort.py](./algorithms/sort/wiggle_sort.py) + * [stack](./algorithms/stack) + * [is_consecutive.py](./algorithms/stack/is_consecutive.py) + * [is_sorted.py](./algorithms/stack/is_sorted.py) + * [longest_abs_path.py](./algorithms/stack/longest_abs_path.py) + * [ordered_stack.py](./algorithms/stack/ordered_stack.py) + * [remove_min.py](./algorithms/stack/remove_min.py) + * [simplify_path.py](./algorithms/stack/simplify_path.py) + * [stack.py](./algorithms/stack/stack.py) + * [stutter.py](./algorithms/stack/stutter.py) + * [switch_pairs.py](./algorithms/stack/switch_pairs.py) + * [valid_parenthesis.py](./algorithms/stack/valid_parenthesis.py) + * [streaming](./algorithms/streaming) + * [misra_gries.py](./algorithms/streaming/misra_gries.py) + * [one_sparse_recovery.py](./algorithms/streaming/one_sparse_recovery.py) + * [strings](./algorithms/strings) + * [add_binary.py](./algorithms/strings/add_binary.py) + * [atbash_cipher.py](./algorithms/strings/atbash_cipher.py) + * [breaking_bad.py](./algorithms/strings/breaking_bad.py) + * [caesar_cipher.py](./algorithms/strings/caesar_cipher.py) + * [check_pangram.py](./algorithms/strings/check_pangram.py) + * [contain_string.py](./algorithms/strings/contain_string.py) + * [count_binary_substring.py](./algorithms/strings/count_binary_substring.py) + * [decode_string.py](./algorithms/strings/decode_string.py) + * [delete_reoccurring.py](./algorithms/strings/delete_reoccurring.py) + * [domain_extractor.py](./algorithms/strings/domain_extractor.py) + * [encode_decode.py](./algorithms/strings/encode_decode.py) + * [first_unique_char.py](./algorithms/strings/first_unique_char.py) + * [fizzbuzz.py](./algorithms/strings/fizzbuzz.py) + * [group_anagrams.py](./algorithms/strings/group_anagrams.py) + * [int_to_roman.py](./algorithms/strings/int_to_roman.py) + * [is_palindrome.py](./algorithms/strings/is_palindrome.py) + * [is_rotated.py](./algorithms/strings/is_rotated.py) + * [judge_circle.py](./algorithms/strings/judge_circle.py) + * [knuth_morris_pratt.py](./algorithms/strings/knuth_morris_pratt.py) + * [license_number.py](./algorithms/strings/license_number.py) + * [longest_common_prefix.py](./algorithms/strings/longest_common_prefix.py) + * [longest_palindromic_substring.py](./algorithms/strings/longest_palindromic_substring.py) + * [make_sentence.py](./algorithms/strings/make_sentence.py) + * [merge_string_checker.py](./algorithms/strings/merge_string_checker.py) + * [min_distance.py](./algorithms/strings/min_distance.py) + * [multiply_strings.py](./algorithms/strings/multiply_strings.py) + * [one_edit_distance.py](./algorithms/strings/one_edit_distance.py) + * [panagram.py](./algorithms/strings/panagram.py) + * [rabin_karp.py](./algorithms/strings/rabin_karp.py) + * [repeat_string.py](./algorithms/strings/repeat_string.py) + * [repeat_substring.py](./algorithms/strings/repeat_substring.py) + * [reverse_string.py](./algorithms/strings/reverse_string.py) + * [reverse_vowel.py](./algorithms/strings/reverse_vowel.py) + * [reverse_words.py](./algorithms/strings/reverse_words.py) + * [roman_to_int.py](./algorithms/strings/roman_to_int.py) + * [rotate.py](./algorithms/strings/rotate.py) + * [strip_url_params.py](./algorithms/strings/strip_url_params.py) + * [strong_password.py](./algorithms/strings/strong_password.py) + * [text_justification.py](./algorithms/strings/text_justification.py) + * [unique_morse.py](./algorithms/strings/unique_morse.py) + * [validate_coordinates.py](./algorithms/strings/validate_coordinates.py) + * [word_squares.py](./algorithms/strings/word_squares.py) + * [tree](./algorithms/tree) + * [b_tree.py](./algorithms/tree/b_tree.py) + * [bin_tree_to_list.py](./algorithms/tree/bin_tree_to_list.py) + * [binary_tree_paths.py](./algorithms/tree/binary_tree_paths.py) + * [construct_tree_postorder_preorder.py](./algorithms/tree/construct_tree_postorder_preorder.py) + * [deepest_left.py](./algorithms/tree/deepest_left.py) + * [invert_tree.py](./algorithms/tree/invert_tree.py) + * [is_balanced.py](./algorithms/tree/is_balanced.py) + * [is_subtree.py](./algorithms/tree/is_subtree.py) + * [is_symmetric.py](./algorithms/tree/is_symmetric.py) + * [longest_consecutive.py](./algorithms/tree/longest_consecutive.py) + * [lowest_common_ancestor.py](./algorithms/tree/lowest_common_ancestor.py) + * [max_height.py](./algorithms/tree/max_height.py) + * [max_path_sum.py](./algorithms/tree/max_path_sum.py) + * [min_height.py](./algorithms/tree/min_height.py) + * [path_sum.py](./algorithms/tree/path_sum.py) + * [path_sum2.py](./algorithms/tree/path_sum2.py) + * [pretty_print.py](./algorithms/tree/pretty_print.py) + * [same_tree.py](./algorithms/tree/same_tree.py) + * [tree.py](./algorithms/tree/tree.py) + * [avl](./algorithms/tree/avl) + * [avl.py](./algorithms/tree/avl/avl.py) + * [bst](./algorithms/tree/bst) + * [BSTIterator.py](./algorithms/tree/bst/BSTIterator.py) + * [array_to_bst.py](./algorithms/tree/bst/array_to_bst.py) + * [bst.py](./algorithms/tree/bst/bst.py) + * [bst_closest_value.py](./algorithms/tree/bst/bst_closest_value.py) + * [count_left_node.py](./algorithms/tree/bst/count_left_node.py) + * [delete_node.py](./algorithms/tree/bst/delete_node.py) + * [depth_sum.py](./algorithms/tree/bst/depth_sum.py) + * [height.py](./algorithms/tree/bst/height.py) + * [is_bst.py](./algorithms/tree/bst/is_bst.py) + * [kth_smallest.py](./algorithms/tree/bst/kth_smallest.py) + * [lowest_common_ancestor.py](./algorithms/tree/bst/lowest_common_ancestor.py) + * [num_empty.py](./algorithms/tree/bst/num_empty.py) + * [predecessor.py](./algorithms/tree/bst/predecessor.py) + * [serialize_deserialize.py](./algorithms/tree/bst/serialize_deserialize.py) + * [successor.py](./algorithms/tree/bst/successor.py) + * [unique_bst.py](./algorithms/tree/bst/unique_bst.py) + * [fenwick_tree](./algorithms/tree/fenwick_tree) + * [fenwick_tree.py](./algorithms/tree/fenwick_tree/fenwick_tree.py) + * [red_black_tree](./algorithms/tree/red_black_tree) + * [red_black_tree.py](./algorithms/tree/red_black_tree/red_black_tree.py) + * [segment_tree](./algorithms/tree/segment_tree) + * [iterative_segment_tree.py](./algorithms/tree/segment_tree/iterative_segment_tree.py) + * [segment_tree.py](./algorithms/tree/segment_tree/segment_tree.py) + * [traversal](./algorithms/tree/traversal) + * [inorder.py](./algorithms/tree/traversal/inorder.py) + * [level_order.py](./algorithms/tree/traversal/level_order.py) + * [postorder.py](./algorithms/tree/traversal/postorder.py) + * [preorder.py](./algorithms/tree/traversal/preorder.py) + * [zigzag.py](./algorithms/tree/traversal/zigzag.py) + * [trie](./algorithms/tree/trie) + * [add_and_search.py](./algorithms/tree/trie/add_and_search.py) + * [trie.py](./algorithms/tree/trie/trie.py) + * [unionfind](./algorithms/unionfind) + * [count_islands.py](./algorithms/unionfind/count_islands.py) + * [unix](./algorithms/unix) + * [path](./algorithms/unix/path) + * [full_path.py](./algorithms/unix/path/full_path.py) + * [join_with_slash.py](./algorithms/unix/path/join_with_slash.py) + * [simplify_path.py](./algorithms/unix/path/simplify_path.py) + * [split.py](./algorithms/unix/path/split.py) + ## Contributors Thanks to [all the contributors](https://github.com/keon/algorithms/graphs/contributors) diff --git a/scripts/update_functions_list.py b/scripts/update_functions_list.py new file mode 100644 index 000000000..db61d2980 --- /dev/null +++ b/scripts/update_functions_list.py @@ -0,0 +1,25 @@ +import os + +fnc_list = "\n" # prefix + implemented functions list +for (path, dir, folders) in sorted(os.walk("./algorithms"))[1:]: # first folder is 'algorithms' so skiped that + + if '.py' not in path.split(os.path.sep)[-1]: + fnc_list += (path.count(os.sep)-1) * " " + '* [' + path.split(os.path.sep)[-1] + '](' + path + ')\n' + for filename in sorted(folders): + ext = os.path.splitext(filename)[-1] + if ext == '.py' and filename != '__init__.py': + fnc_list += path.count(os.sep) * " " + '* [' + filename + '](' + os.path.join(path, filename) + ')\n' + +fnc_list += "\n" # suffix + +f = open("README.md", 'r') +README = f.read() # read existing README.md +f.close() + +f = open("README.md", 'w') +# change existing implemented functions list to new list +replace_str = '' + README.split('')[1].split('')[0] + '\n' +README = README.replace(replace_str, fnc_list) +f.write(README) # update README.md +f.close() +