Repository: keon/algorithms
Pull request #286 (2018-05-25 20:07:37)

[Work in Progress] reorganization (#278)
#278
I was working to change everything at once until realized that this is too much change.
So I am committing the changes one piece at a time to this PR.

For every categories below, I am doing the following:
- putting every files inside `algorithms` folder
- changing some names of files and algorithms
- updating tests

- [x] arrays
- [x] backtrack
- [x] bfs
- [x] dfs
- [x] dp
- [x] graph
- [x] heap
- [x] linkedlist
- [x] map
- [x] maths
- [x] matrix
- [x] queues
- [x] search
- [x] set
- [x] sort
- [x] stack
- [x] strings




Patch:
diff --git a/README.md b/README.md
index fce6c05..64195d3 100644
--- a/README.md
+++ b/README.md
@@ -37,11 +37,11 @@ If you want to use the API algorithms in your code, it is as simple as:
 You can test by creating a python file: (Ex: use `merge_sort` in `sort`)
 
 ```python3
-from sort import merge_sort
+from algorithms.sort import merge_sort
 
 if __name__ == "__main__":
     my_list = [1, 8, 3, 5, 6]
-    my_list = merge_sort.merge_sort(my_list)
+    my_list = merge_sort(my_list)
     print(my_list)
 ```
 
@@ -52,260 +52,260 @@ If you want to uninstall algorithms, it is as simple as:
 
 ## List of Implementations
 
-- [arrays](arrays)
-    - [delete_nth](arrays/delete_nth.py)
-    - [flatten](arrays/flatten.py)
-    - [garage](arrays/garage.py)
-    - [josephus_problem](arrays/josephus_problem.py)
-    - [longest_non_repeat](arrays/longest_non_repeat.py/)
-    - [merge_intervals](arrays/merge_intervals.py)
-    - [missing_ranges](arrays/missing_ranges.py)
-    - [plus_one](arrays/plus_one.py)
-    - [rotate_array](arrays/rotate_array.py)
-    - [summary_ranges](arrays/summary_ranges.py)
-    - [three_sum](arrays/three_sum.py)
-    - [two_sum](arrays/two_sum.py)
-    - [move_zeros_to_end](arrays/move_zeros_to_end.py)
-- [backtrack](backtrack)
-    - [general_solution.md](backtrack/)
-    - [anagram](backtrack/anagram.py)
-    - [array_sum_combinations](backtrack/array_sum_combinations.py)
-    - [combination_sum](backtrack/combination_sum.py)
-    - [expression_add_operators](backtrack/expression_add_operators.py)
-    - [factor_combinations](backtrack/factor_combinations.py)
-    - [generate_abbreviations](backtrack/generate_abbreviations.py)
-    - [generate_parenthesis](backtrack/generate_parenthesis.py)
-    - [letter_combination](backtrack/letter_combination.py)
-    - [palindrome_partitioning](backtrack/palindrome_partitioning.py)
-    - [pattern_match](backtrack/pattern_match.py)
-    - [permute](backtrack/permute.py)
-    - [permute_unique](backtrack/permute_unique.py)
-    - [subsets](backtrack/subsets.py)
-    - [subsets_unique](backtrack/subsets_unique.py)
-- [bfs](bfs)
-    - [shortest_distance_from_all_buildings](bfs/shortest_distance_from_all_buildings.py)
-    - [word_ladder](bfs/word_ladder.py)
-- [bit](bit)
-    - [bytes_int_conversion](bit/bytes_int_conversion.py)
-    - [count_ones](bit/count_ones.py)
-    - [find_missing_number](bit/find_missing_number.py)
-    - [power_of_two](bit/power_of_two.py)
-    - [reverse_bits](bit/reverse_bits.py)
-    - [single_number](bit/single_number.py)
-    - [single_number2](bit/single_number2.py)
-    - [single_number3](bit/single_number3.py)
-    - [subsets](bit/subsets.py)
-    - [add_bitwise_operator](bit/add_bitwise_operator.py)
-    - [bit_operation](bit/bit_operation.py)
-    - [swap_pair](bit/swap_pair.py)
-    - [find_difference](bit/find_difference.py)
-    - [has_alternative_bit](bit/has_alternative_bit.py)
-    - [insert_bit](bit/insert_bit.py)
-    - [remove_bit](bit/remove_bit.py)
-- [calculator](calculator)
-    - [math_parser](calculator/math_parser.py)
-- [dfs](dfs)
-    - [all_factors](dfs/all_factors.py)
-    - [count_islands](dfs/count_islands.py)
-    - [pacific_atlantic](dfs/pacific_atlantic.py)
-    - [sudoku_solver](dfs/sudoku_solver.py)
-    - [walls_and_gates](dfs/walls_and_gates.py)
-- [dp](dp)
-    - [buy_sell_stock](dp/buy_sell_stock.py)
-    - [climbing_stairs](dp/climbing_stairs.py)
-    - [coin_change](dp/coin_change.py)
-    - [combination_sum](dp/combination_sum.py)
-    - [egg_drop](dp/egg_drop.py)
-    - [house_robber](dp/house_robber.py)
-    - [job_scheduling](dp/job_scheduling.py)
-    - [knapsack](dp/knapsack.py)
-    - [longest_increasing](dp/longest_increasing.py)
-    - [matrix_chain_order](dp/matrix_chain_order.py)
-    - [max_product_subarray](dp/max_product_subarray.py)
-    - [max_subarray](dp/max_subarray.py)
-    - [min_cost_path](dp/min_cost_path.py)
-    - [num_decodings](dp/num_decodings.py)
-    - [regex_matching](dp/regex_matching.py)
-    - [rod_cut](dp/rod_cut.py)
-    - [word_break](dp/word_break.py)
-    - [fibonacci](dp/fib.py)
-- [graph](graph)
-    - [strongly_connected](graph/checkDiGraphStronglyConnected.py)
-    - [clone_graph](graph/clone_graph.py)
-    - [cycle_detection](graph/cycle_detection.py)
-    - [find_all_cliques](graph/find_all_cliques.py)
-    - [find_path](graph/find_path.py)
-    - [graph](graph/graph.py)
-    - [markov_chain](graph/markov_chain.py)
-    - [minimum_spanning_tree](graph/minimum_spanning_tree.py)
-    - [satisfiability](graph/satisfiability.py)
-    - [tarjan](graph/tarjan.py)
-    - [traversal](graph/traversal.py)
-- [heap](heap)
-    - [merge_sorted_k_lists](heap/merge_sorted_k_lists.py)
-    - [skyline](heap/skyline.py)
-    - [sliding_window_max](heap/sliding_window_max.py)
-    - [binary_heap](heap/binary_heap.py)
-- [linkedlist](linkedlist)
-    - [add_two_numbers](linkedlist/add_two_numbers.py)
-    - [copy_random_pointer](linkedlist/copy_random_pointer.py)
-    - [delete_node](linkedlist/delete_node.py)
-    - [first_cyclic_node](linkedlist/first_cyclic_node.py)
-    - [is_cyclic](linkedlist/is_cyclic.py)
-    - [is_palindrome](linkedlist/is_palindrome.py)
-    - [kth_to_last](linkedlist/kth_to_last.py)
-    - [linkedlist](linkedlist/linkedlist.py)
-    - [remove_duplicates](linkedlist/remove_duplicates.py)
-    - [reverse](linkedlist/reverse.py)
-    - [rotate_list](linkedlist/rotate_list.py)
-    - [swap_in_pairs](linkedlist/swap_in_pairs.py)
-    - [is_sorted](linkedlist/is_sorted.py)
-    - [remove_range](linkedlist/remove_range.py)
-- [map](map)
-    - [hashtable](map/hashtable.py)
-    - [separate_chaining_hashtable](map/separate_chaining_hashtable.py)
-    - [longest_common_subsequence](map/longest_common_subsequence.py)
-    - [randomized_set](map/randomized_set.py)
-    - [valid_sudoku](map/valid_sudoku.py)
-- [maths](maths)
-    - [base_conversion](maths/base_conversion.py)
-    - [extended_gcd](maths/extended_gcd.py)
-    - [gcd/lcm](maths/gcd.py)
-    - [generate_strobogrammtic](maths/generate_strobogrammtic.py)
-    - [is_strobogrammatic](maths/is_strobogrammatic.py)
-    - [next_bigger](maths/next_bigger.py)
-    - [next_perfect_square](maths/next_perfect_square.py)
-    - [nth_digit](maths/nth_digit.py)
-    - [prime_check](maths/prime_check.py)
-    - [primes_sieve_of_eratosthenes](maths/primes_sieve_of_eratosthenes.py)
-    - [pythagoras](maths/pythagoras.py)
-    - [rabin_miller](maths/rabin_miller.py)
-    - [rsa](maths/rsa.py)
-    - [sqrt_precision_factor](maths/sqrt_precision_factor.py)
-    - [summing_digits](maths/summing_digits.py)
-- [matrix](matrix)
-    - [sudoku_validator](matrix/sudoku_validator.py)
-    - [bomb_enemy](matrix/bomb_enemy.py)
-    - [copy_transform](matrix/copy_transform.py)
-    - [count_paths](matrix/count_paths.py)
-    - [matrix_rotation.txt](matrix/matrix_rotation.txt)
-    - [rotate_image](matrix/rotate_image.py)
-    - [search_in_sorted_matrix](matrix/search_in_sorted_matrix.py)
-    - [sparse_dot_vector](matrix/sparse_dot_vector.py)
-    - [sparse_mul](matrix/sparse_mul.py)
-    - [spiral_traversal](matrix/spiral_traversal.py)
-- [queues](queues)
-    - [max_sliding_window](queues/max_sliding_window.py)
-    - [moving_average](queues/moving_average.py)
-    - [queue](queues/queue.py)
-    - [reconstruct_queue](queues/reconstruct_queue.py)
-    - [zigzagiterator](queues/zigzagiterator.py)
-- [search](search)
-    - [binary_search](search/binary_search.py)
-    - [first_occurance](search/first_occurance.py)
-    - [last_occurance](search/last_occurance.py)
-    - [search_insert](search/search_insert.py)
-    - [two_sum](search/two_sum.py)
-    - [search_range](search/search_range.py)
-    - [find_min_rotate](search/find_min_rotate.py)
-    - [search_rotate](search/search_rotate.py)
-- [set](set)
-    - [randomized_set](set/randomized_set.py)
-    - [set_covering](set/set_covering.py)
-- [sort](sort)
-    - [bubble_sort](sort/bubble_sort.py)
-    - [comb_sort](sort/comb_sort.py)
-    - [counting_sort](sort/counting_sort.py)
-    - [heap_sort](sort/heap_sort.py)
-    - [insertion_sort](sort/insertion_sort.py)
-    - [meeting_rooms](sort/meeting_rooms.py)
-    - [merge_sort](sort/merge_sort.py)
-    - [quick_sort](sort/quick_sort.py)
-    - [selection_sort](sort/selection_sort.py)
-    - [sort_colors](sort/sort_colors.py)
-    - [topsort](sort/topsort.py)
-    - [wiggle_sort](sort/wiggle_sort.py)
-- [stack](stack)
-    - [longest_abs_path](stack/longest_abs_path.py)
-    - [simplify_path](stack/simplify_path.py)
-    - [stack](stack/stack.py)
-    - [valid_parenthesis](stack/valid_parenthesis.py)
-    - [stutter](stack/stutter.py)
-    - [switch_pairs](stack/switch_pairs.py)
-    - [is_consecutive](stack/is_consecutive.py)
-    - [remove_min](stack/remove_min.py)
-    - [is_sorted](stack/is_sorted.py)
-- [strings](strings)
-    - [fizzbuzz](strings/fizzbuzz.py)
-    - [delete_reoccurring_characters](strings/delete_reoccurring_characters.py)
-    - [strip_url_params](strings/strip_url_params.py)
-    - [validate_coordinates](strings/validate_coordinates.py)
-    - [domain_extractor](strings/domain_extractor.py)
-    - [merge_string_checker](strings/merge_string_checker.py)
-    - [add_binary](strings/add_binary.py)
-    - [breaking_bad](strings/breaking_bad.py)
-    - [decode_string](strings/decode_string.py)
-    - [encode_decode](strings/encode_decode.py)
-    - [group_anagrams](strings/group_anagrams.py)
-    - [int_to_roman](strings/int_to_roman.py)
-    - [is_palindrome](strings/is_palindrome.py)
-    - [license_number](strings/license_number.py)
-    - [make_sentence](strings/make_sentence.py)
-    - [multiply_strings](strings/multiply_strings.py)
-    - [one_edit_distance](strings/one_edit_distance.py)
-    - [rabin_karp](strings/rabin_karp.py)
-    - [reverse_string](strings/reverse_string.py)
-    - [reverse_vowel](strings/reverse_vowel.py)
-    - [reverse_words](strings/reverse_words.py)
-    - [roman_to_int](strings/roman_to_int.py)
-    - [word_squares](strings/word_squares.py)
-- [tree](tree)
-    - [bst](tree/tree/bst)
-        - [array2bst](tree/bst/array2bst.py)
-        - [bst_closest_value](tree/bst/bst_closest_value.py)
-        - [BSTIterator](tree/bst/BSTIterator.py)
-        - [delete_node](tree/bst/delete_node.py)
-        - [is_bst](tree/bst/is_bst.py)
-        - [kth_smallest](tree/bst/kth_smallest.py)
-        - [lowest_common_ancestor](tree/bst/lowest_common_ancestor.py)
-        - [predecessor](tree/bst/predecessor.py)
-        - [serialize_deserialize](tree/bst/serialize_deserialize.py)
-        - [successor](tree/bst/successor.py)
-        - [unique_bst](tree/bst/unique_bst.py)
-        - [depth_sum](tree/bst/depth_sum.py)
-        - [count_left_node](tree/bst/count_left_node.py)
-        - [num_empty](tree/bst/num_empty.py)
-        - [height](tree/bst/height.py)
-    - [red_black_tree](tree/red_black_tree)
-        - [red_black_tree](tree/red_black_tree/red_black_tree.py)
-    - [segment_tree](tree/segment_tree)
-        - [segment_tree](tree/segment_tree/segment_tree.py)
-    - [traversal](tree/traversal)
-        - [inorder](tree/traversal/inorder.py)
-        - [level_order](tree/traversal/level_order.py)
-        - [zigzag](tree/traversal/zigzag.py)
-    - [trie](tree/trie)
-        - [add_and_search](tree/trie/add_and_search.py)
-        - [trie](tree/trie/trie.py)
-    - [binary_tree_paths](tree/binary_tree_paths.py)
-    - [bintree2list](tree/bintree2list.py)
-    - [deepest_left](tree/deepest_left.py)
-    - [invert_tree](tree/invert_tree.py)
-    - [is_balanced](tree/is_balanced.py)
-    - [is_subtree](tree/is_subtree.py)
-    - [is_symmetric](tree/is_symmetric.py)
-    - [longest_consecutive](tree/longest_consecutive.py)
-    - [lowest_common_ancestor](tree/lowest_common_ancestor.py)
-    - [max_height](tree/max_height.py)
-    - [max_path_sum](tree/max_path_sum.py)
-    - [min_height](tree/min_height.py)
-    - [path_sum](tree/path_sum.py)
-    - [path_sum2](tree/path_sum2.py)
-    - [pretty_print](tree/pretty_print.py)
-    - [same_tree](tree/same_tree.py)
-    - [tree](tree/tree.py)
-- [union-find](union-find)
-    - [count_islands](union-find/count_islands.py)
+- [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_problem.py)
+    - [longest_non_repeat](algorithms/arrays/longest_non_repeat.py/)
+    - [merge_intervals](algorithms/arrays/merge_intervals.py)
+    - [missing_ranges](algorithms/arrays/missing_ranges.py)
+    - [plus_one](algorithms/arrays/plus_one.py)
+    - [rotate_array](algorithms/arrays/rotate_array.py)
+    - [summary_ranges](algorithms/arrays/summary_ranges.py)
+    - [three_sum](algorithms/arrays/three_sum.py)
+    - [two_sum](algorithms/arrays/two_sum.py)
+    - [move_zeros_to_end](algorithms/arrays/move_zeros_to_end.py)
+- [backtrack](algorithms/backtrack)
+    - [general_solution.md](algorithms/backtrack/)
+    - [anagram](algorithms/backtrack/anagram.py)
+    - [array_sum_combinations](algorithms/backtrack/array_sum_combinations.py)
+    - [combination_sum](algorithms/backtrack/combination_sum.py)
+    - [expression_add_operators](algorithms/backtrack/expression_add_operators.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)
+    - [shortest_distance_from_all_buildings](algorithms/bfs/shortest_distance_from_all_buildings.py)
+    - [word_ladder](algorithms/bfs/word_ladder.py)
+- [bit](algorithms/bit)
+    - [bytes_int_conversion](algorithms/bit/bytes_int_conversion.py)
+    - [count_ones](algorithms/bit/count_ones.py)
+    - [find_missing_number](algorithms/bit/find_missing_number.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)
+    - [add_bitwise_operator](algorithms/bit/add_bitwise_operator.py)
+    - [bit_operation](algorithms/bit/bit_operation.py)
+    - [swap_pair](algorithms/bit/swap_pair.py)
+    - [find_difference](algorithms/bit/find_difference.py)
+    - [has_alternative_bit](algorithms/bit/has_alternative_bit.py)
+    - [insert_bit](algorithms/bit/insert_bit.py)
+    - [remove_bit](algorithms/bit/remove_bit.py)
+- [calculator](algorithms/calculator)
+    - [math_parser](algorithms/calculator/math_parser.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)
+- [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)
+    - [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)
+- [graph](algorithms/graph)
+    - [strongly_connected](algorithms/graph/checkDiGraphStronglyConnected.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)
+    - [markov_chain](algorithms/graph/markov_chain.py)
+    - [minimum_spanning_tree](algorithms/graph/minimum_spanning_tree.py)
+    - [satisfiability](algorithms/graph/satisfiability.py)
+    - [tarjan](algorithms/graph/tarjan.py)
+    - [traversal](algorithms/graph/traversal.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)
+- [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)
+    - [randomized_set](algorithms/map/randomized_set.py)
+    - [valid_sudoku](algorithms/map/valid_sudoku.py)
+- [maths](algorithms/maths)
+    - [base_conversion](algorithms/maths/base_conversion.py)
+    - [extended_gcd](algorithms/maths/extended_gcd.py)
+    - [gcd/lcm](algorithms/maths/gcd.py)
+    - [generate_strobogrammtic](algorithms/maths/generate_strobogrammtic.py)
+    - [is_strobogrammatic](algorithms/maths/is_strobogrammatic.py)
+    - [next_bigger](algorithms/maths/next_bigger.py)
+    - [next_perfect_square](algorithms/maths/next_perfect_square.py)
+    - [nth_digit](algorithms/maths/nth_digit.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)
+    - [rsa](algorithms/maths/rsa.py)
+    - [sqrt_precision_factor](algorithms/maths/sqrt_precision_factor.py)
+    - [summing_digits](algorithms/maths/summing_digits.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_rotation.txt](algorithms/matrix/matrix_rotation.txt)
+    - [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)
+- [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_occurance](algorithms/search/first_occurance.py)
+    - [last_occurance](algorithms/search/last_occurance.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)
+- [set](algorithms/set)
+    - [randomized_set](algorithms/set/randomized_set.py)
+    - [set_covering](algorithms/set/set_covering.py)
+- [sort](algorithms/sort)
+    - [bubble_sort](algorithms/sort/bubble_sort.py)
+    - [comb_sort](algorithms/sort/comb_sort.py)
+    - [counting_sort](algorithms/sort/counting_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)
+    - [quick_sort](algorithms/sort/quick_sort.py)
+    - [selection_sort](algorithms/sort/selection_sort.py)
+    - [sort_colors](algorithms/sort/sort_colors.py)
+    - [topsort](algorithms/sort/topsort.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)
+- [strings](algorithms/strings)
+    - [fizzbuzz](algorithms/strings/fizzbuzz.py)
+    - [delete_reoccurring_characters](algorithms/strings/delete_reoccurring_characters.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)
+- [tree](algorithms/tree)
+    - [bst](algorithms/tree/tree/bst)
+        - [array2bst](algorithms/tree/bst/array2bst.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)
+    - [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)
+    - [traversal](algorithms/tree/traversal)
+        - [inorder](algorithms/tree/traversal/inorder.py)
+        - [level_order](algorithms/tree/traversal/level_order.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)
+    - [binary_tree_paths](algorithms/tree/binary_tree_paths.py)
+    - [bintree2list](algorithms/tree/bintree2list.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)
+- [union-find](algorithms/union-find)
+    - [count_islands](algorithms/union-find/count_islands.py)
 
 ## Contributors
 The repo is maintained by
diff --git a/README_CN.md b/README_CN.md
index c612cd5..af502aa 100644
--- a/README_CN.md
+++ b/README_CN.md
@@ -42,16 +42,16 @@ pip3 install git+https://github.com/keon/algorithms
 
 ```
 
-通过创建python文件(比如：在sort模块使用merge_sort)进行测试： 
+通过创建python文件(比如：在sort模块使用merge_sort)进行测试：
 ```
 
-from sort import merge_sort
+from algorithms.sort import merge_sort
 
 if __name__ == "__main__":
     my_list = [1, 8, 3, 5, 6]
-    my_list = merge_sort.merge_sort(my_list)
+    my_list = merge_sort(my_list)
     print(my_list)
-    
+
 ```
 
 ## 卸载
@@ -66,212 +66,212 @@ pip3 uninstall -y algorithms
 ## 实现列表
 
 - [array:数组](arrays)
-    - [delete_nth: 删除第n项](arrays/delete_nth.py)
-    - [flatten：数组降维](arrays/flatten.py)
-    - [garage：停车场](arrays/garage.py)
-    - [josephus_problem: 约瑟夫问题](arrays/josephus_problem.py)
-    - [longest_non_repeat：最长不重复子串](arrays/longest_non_repeat.py/)
-    - [merge_intervals：合并重叠间隔](arrays/merge_intervals.py)
-    - [missing_ranges：遗失的范围](arrays/missing_ranges.py)
-    - [plus_one：加一运算](arrays/plus_one.py)
-    - [rotate_array：反转数组](arrays/rotate_array.py)
-    - [summary_ranges：数组范围](arrays/summary_ranges.py)
-    - [three_sum：三数和为零](arrays/three_sum.py)
-    - [two_sum：两数和](arrays/two_sum.py)
-    - [move_zeros_to_end: 0后置问题](arrays/move_zeros_to_end.py)
-- [backtrack：回溯](backtrack)
-    - [general_solution.md：一般方法](backtrack/)
-    - [anagram：同字母异序词](backtrack/anagram.py)
-    - [array_sum_combinations：数组和](backtrack/array_sum_combinations.py)
-    - [combination_sum：和的合并](backtrack/combination_sum.py)
-    - [expression_add_operators：给表达式添加运算符](backtrack/expression_add_operators.py)
-    - [factor_combinations：因素组合](backtrack/factor_combinations.py)
-    - [generate_abbreviations：缩写生成](backtrack/generate_abbreviations.py)
-    - [generate_parenthesis：括号生成](backtrack/generate_parenthesis.py)
-    - [letter_combination：字母组合](backtrack/letter_combination.py)
-    - [palindrome_partitioning：字符串的所有回文子串](backtrack/palindrome_partitioning.py)
-    - [pattern_match：模式匹配](backtrack/pattern_match.py)
-    - [permute：排列](backtrack/permute.py)
-    - [permute_unique：唯一排列](backtrack/permute_unique.py)
-    - [subsets：子集](backtrack/subsets.py)
-    - [subsets_unique：唯一子集](backtrack/subsets_unique.py)
-- [bfs：广度优先搜索](bfs)
-    - [shortest_distance_from_all_buildings：所有建筑物的最短路径：](bfs/shortest_distance_from_all_buildings.py)
-    - [word_ladder：词语阶梯](bfs/word_ladder.py)
-- [bit：位操作](bit)
-    - [bytes_int_conversion：字节整数转换](bit/bytes_int_conversion.py)
-    - [count_ones：统计1出现的次数](bit/count_ones.py)
-    - [find_missing_number：寻找缺失数](bit/find_missing_number.py)
-    - [power_of_two：2的n次方数判断](bit/power_of_two.py)
-    - [reverse_bits：反转位](bit/reverse_bits.py)
-    - [single_number2：寻找出现1次的数（2)](bit/single_number2.py)
-    - [single_number:寻找出现1次的数（1)](bit/single_number.py)
-    - [subsets: 求所有子集](bit/subsets.py)
-    - [add_bitwise_operator：无操作符的加法](bit/add_bitwise_operator.py)
-- [calculator：计算](calculator)
-    - [math_parser: 数字解析](calculator/math_parser.py)
-- [dfs：深度优先搜索](dfs)
-    - [all_factors：因素分解](dfs/all_factors.py)
-    - [count_islands：岛计数](dfs/count_islands.py)
-    - [pacific_atlantic：太平洋大西洋](dfs/pacific_atlantic.py)
-    - [sudoku_solver：数独解法](dfs/sudoku_solver.py)
-    - [walls_and_gates：墙和门](dfs/walls_and_gates.py)
-- [dp：动态规划](dp)
-    - [buy_sell_stock：股票买卖](dp/buy_sell_stock.py)
-    - [climbing_stairs：爬梯子问题](dp/climbing_stairs.py)
-    - [combination_sum：和组合问题](dp/combination_sum.py)
-    - [house_robber：打家劫舍](dp/house_robber.py)
-    - [knapsack：背包问题](dp/knapsack.py)
-    - [longest_increasing：最长递增子序列](dp/longest_increasing.py)
-    - [max_product_subarray：最大子数组乘积](dp/max_product_subarray.py)
-    - [max_subarray：最大子数组](dp/max_subarray.py)
-    - [num_decodings：数字解码](dp/num_decodings.py)
-    - [regex_matching：正则匹配](dp/regex_matching.py)
-    - [word_break：单词分割](dp/word_break.py)
+    - [delete_nth: 删除第n项](algorithms/arrays/delete_nth.py)
+    - [flatten：数组降维](algorithms/arrays/flatten.py)
+    - [garage：停车场](algorithms/arrays/garage.py)
+    - [josephus_problem: 约瑟夫问题](algorithms/arrays/josephus_problem.py)
+    - [longest_non_repeat：最长不重复子串](algorithms/arrays/longest_non_repeat.py/)
+    - [merge_intervals：合并重叠间隔](algorithms/arrays/merge_intervals.py)
+    - [missing_ranges：遗失的范围](algorithms/arrays/missing_ranges.py)
+    - [plus_one：加一运算](algorithms/arrays/plus_one.py)
+    - [rotate_array：反转数组](algorithms/arrays/rotate_array.py)
+    - [summary_ranges：数组范围](algorithms/arrays/summary_ranges.py)
+    - [three_sum：三数和为零](algorithms/arrays/three_sum.py)
+    - [two_sum：两数和](algorithms/arrays/two_sum.py)
+    - [move_zeros_to_end: 0后置问题](algorithms/arrays/move_zeros_to_end.py)
+- [backtrack：回溯](algorithms/backtrack)
+    - [general_solution.md：一般方法](algorithms/backtrack/)
+    - [anagram：同字母异序词](algorithms/backtrack/anagram.py)
+    - [array_sum_combinations：数组和](algorithms/backtrack/array_sum_combinations.py)
+    - [combination_sum：和的合并](algorithms/backtrack/combination_sum.py)
+    - [expression_add_operators：给表达式添加运算符](algorithms/backtrack/expression_add_operators.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)
+    - [shortest_distance_from_all_buildings：所有建筑物的最短路径：](algorithms/bfs/shortest_distance_from_all_buildings.py)
+    - [word_ladder：词语阶梯](algorithms/bfs/word_ladder.py)
+- [bit：位操作](algorithms/bit)
+    - [bytes_int_conversion：字节整数转换](algorithms/bit/bytes_int_conversion.py)
+    - [count_ones：统计1出现的次数](algorithms/bit/count_ones.py)
+    - [find_missing_number：寻找缺失数](algorithms/bit/find_missing_number.py)
+    - [power_of_two：2的n次方数判断](algorithms/bit/power_of_two.py)
+    - [reverse_bits：反转位](algorithms/bit/reverse_bits.py)
+    - [single_number2：寻找出现1次的数（2)](algorithms/bit/single_number2.py)
+    - [single_number:寻找出现1次的数（1)](algorithms/bit/single_number.py)
+    - [subsets: 求所有子集](algorithms/bit/subsets.py)
+    - [add_bitwise_operator：无操作符的加法](algorithms/bit/add_bitwise_operator.py)
+- [calculator：计算](algorithms/calculator)
+    - [math_parser: 数字解析](algorithms/calculator/math_parser.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)
+- [dp：动态规划](algorithms/dp)
+    - [buy_sell_stock：股票买卖](algorithms/dp/buy_sell_stock.py)
+    - [climbing_stairs：爬梯子问题](algorithms/dp/climbing_stairs.py)
+    - [combination_sum：和组合问题](algorithms/dp/combination_sum.py)
+    - [house_robber：打家劫舍](algorithms/dp/house_robber.py)
+    - [knapsack：背包问题](algorithms/dp/knapsack.py)
+    - [longest_increasing：最长递增子序列](algorithms/dp/longest_increasing.py)
+    - [max_product_subarray：最大子数组乘积](algorithms/dp/max_product_subarray.py)
+    - [max_subarray：最大子数组](algorithms/dp/max_subarray.py)
+    - [num_decodings：数字解码](algorithms/dp/num_decodings.py)
+    - [regex_matching：正则匹配](algorithms/dp/regex_matching.py)
+    - [word_break：单词分割](algorithms/dp/word_break.py)
 - [graph：图](graph)
-    - [2-sat：2-sat](graph/satisfiability.py)
-    - [clone_graph：克隆图](graph/clone_graph.py)
-    - [cycle_detection：判断圈算法](graph/cycle_detection.py)
-    - [find_path：发现路径](graph/find_path.py)
-    - [graph：图](graph/graph.py)
-    - [traversal：遍历](graph/traversal.py)
-    - [markov_chain：马尔可夫链](graph/markov_chain.py)
-- [heap：堆](heap)
-    - [merge_sorted_k_lists：合并k个有序链](heap/merge_sorted_k_lists.py)
-    - [skyline：天际线](heap/skyline.py)
-    - [sliding_window_max：滑动窗口最大值](heap/sliding_window_max.py)
-- [linkedlist：链表](linkedlist)
-    - [add_two_numbers：链表数相加](linkedlist/add_two_numbers.py)
-    - [copy_random_pointer：复制带有随机指针的链表](linkedlist/copy_random_pointer.py)
-    - [delete_node：删除节点](linkedlist/delete_node.py)
-    - [first_cyclic_node：环链表的第一个节点](linkedlist/first_cyclic_node.py)
-    - [is_cyclic：判断环链表](linkedlist/is_cyclic.py)
-    - [is_palindrome：回文链表](linkedlist/is_palindrome.py)
-    - [kth_to_last：倒数第k个节点](linkedlist/kth_to_last.py)
-    - [linkedlist： 链表](linkedlist/linkedlist.py)
-    - [remove_duplicates：删除重复元素](linkedlist/remove_duplicates.py)
-    - [reverse：反转链表](linkedlist/reverse.py)
-    - [rotate_list：旋转链表](linkedlist/rotate_list.py)
-    - [swap_in_pairs：链表节点交换](linkedlist/swap_in_pairs.py)
-- [map：映射](map)
-    - [hashtable：哈希表](map/hashtable.py)
-    - [separate_chaining_hashtable：拉链法哈希表](map/separate_chaining_hashtable.py)
-    - [longest_common_subsequence：最长公共子序列](map/longest_common_subsequence.py)
-    - [randomized_set：随机集](map/randomized_set.py)
-    - [valid_sudoku：有效数独](map/valid_sudoku.py)
-- [math：数学问题](maths)
-    - [extended_gcd：扩展欧几里得算法](maths/extended_gcd.py)
-    - [gcd/lcm：最大公约数和最小公倍数](maths/gcd.py)
-    - [prime_test：主要测试](maths/prime_test.py)
-    - [primes_sieve_of_eratosthenes：埃拉托色尼的质数筛](maths/primes_sieve_of_eratosthenes.py)
-    - [generate_strobogrammtic：生成对称数](maths/generate_strobogrammtic.py)
-    - [is_strobogrammatic：判断对称数](maths/is_strobogrammatic.py)
-    - [nth_digit：第n位](maths/nth_digit.py)
-    - [rabin_miller：米勒-拉宾素性检验](maths/rabin_miller.py)
-    - [rsa：rsa加密](maths/rsa.py)
-    - [sqrt_precision_factor：开发精度因素](maths/sqrt_precision_factor.py)
-    - [pythagoras：毕达哥拉斯](maths/pythagoras.py)
-- [matrix：矩阵](matrix)
-    - [matrix_rotation：矩阵旋转](matrix/matrix_rotation.txt)
-    - [copy_transform：复制变换](matrix/copy_transform.py)
-    - [bomb_enemy：炸弹人](matrix/bomb_enemy.py)
-    - [rotate_image：旋转图像](matrix/rotate_image.py)
-    - [sparse_dot_vector：解析点向量](matrix/sparse_dot_vector.py)
-    - [sparse_mul：稀疏矩阵](matrix/sparse_mul.py)
-    - [spiral_traversal：循环遍历](matrix/spiral_traversal.py)
-    - [count_paths：计算路径](matrix/count_paths.py)
-- [queue：队列](queues)
-    - [max_sliding_window：最大移动窗口](queues/max_sliding_window.py)
-    - [moving_average：移动平均](queues/moving_average.py)
-    - [queue：队列](queues/queue.py)
-    - [reconstruct_queue：重建队列](queues/reconstruct_queue.py)
-    - [zigzagiterator：锯齿形迭代](queues/zigzagiterator.py)
-- [search：查找](search)
-    - [binary_search：二分查找](search/binary_search.py)
-    - [count_elem：元素计数](search/count_elem.py)
-    - [first_occurance：首次出现](search/first_occurance.py)
-    - [last_occurance：最后一次出现](search/last_occurance.py)
-- [set：集合](set)
-    - [randomized_set：随机集合](set/randomized_set.py)
-    - [set_covering：集合覆盖](set/set_covering.py)
-- [sort：排序](sort)
-    - [bubble_sort：冒泡排序](sort/bubble_sort.py)
-    - [comb_sort：梳排序](sort/comb_sort.py)
-    - [counting_sort：计数排序](sort/counting_sort.py)
-    - [heap_sort：堆排序](sort/heap_sort.py)
-    - [insertion_sort：插入排序](sort/insertion_sort.py)
-    - [meeting_rooms：会议室](sort/meeting_rooms.py)
-    - [merge_sort：归并排序](sort/merge_sort.py)
-    - [quick_sort：快速排序](sort/quick_sort.py)
-    - [selection_sort：选择排序](sort/selection_sort.py)
-    - [sort_colors：颜色排序](sort/sort_colors.py)
-    - [topsort：top排序](sort/topsort.py)
-    - [wiggle_sort：摇摆排序](sort/wiggle_sort.py)
-- [stack：栈](stack)
-    - [longest_abs_path：最长相对路径](stack/longest_abs_path.py)
-    - [simplify_path：简化路径](stack/simplify_path.py)
-    - [stack：栈](stack/stack.py)
-    - [valid_parenthesis：验证括号](stack/valid_parenthesis.py)
-- [string：字符串](strings)
-    - [add_binary：二进制数相加](strings/add_binary.py)
-    - [breaking_bad：打破坏](strings/breaking_bad.py)
-    - [decode_string：字符串编码](strings/decode_string.py)
-    - [encode_decode：编解码](strings/encode_decode.py)
-    - [group_anagrams：群组错位词](strings/group_anagrams.py)
-    - [int_to_roman：整数转换罗马数字](strings/int_to_roman.py)
-    - [is_palindrome：回文字符串](strings/is_palindrome.py)
-    - [license_number：拍照号码](strings/license_number.py)
-    - [make_sentence：造句](strings/make_sentence.py)
-    - [multiply_strings：字符串相乘](strings/multiply_strings.py)
-    - [one_edit_distance：一个编辑距离](strings/one_edit_distance.py)
-    - [rabin_karp：Rabin-Karp 算法](strings/rabin_karp.py)
-    - [reverse_string：反转字符串](strings/reverse_string.py)
-    - [reverse_vowel：反转元音](strings/reverse_vowel.py)
-    - [reverse_words：反转单词](strings/reverse_words.py)
-    - [roman_to_int：罗马数转换整数](strings/roman_to_int.py)
-    - [word_squares：单词平方](strings/word_squares.py)
-- [tree：树](tree)
-    - [segment-tree：线段树](tree/segment_tree)
-        - [segment_tree：线段树](tree/segment_tree/segment_tree.py)
-    - [binary_tree_paths：二叉树路径](tree/binary_tree_paths.py)
-    - [bintree2list：二叉树转换链表](tree/bintree2list.py)
-    - [bst：二叉搜索树](tree/tree/bst)
-        - [array2bst：数组转换](tree/bst/array2bst.py)
-        - [bst_closest_value：最近二叉搜索树值](tree/bst/bst_closest_value.py)
-        - [BSTIterator：二叉搜索树迭代](tree/bst/BSTIterator.py)
-        - [delete_node：删除节点](tree/bst/delete_node.py)
-        - [is_bst：判断二叉搜索树](tree/bst/is_bst.py)
-        - [kth_smallest：二叉搜索树的第k小节点](tree/bst/kth_smallest.py)
-        - [lowest_common_ancestor：最近公共祖先](tree/bst/lowest_common_ancestor.py)
-        - [predecessor：前任](tree/bst/predecessor.py)
-        - [serialize_deserialize：序列化反序列化](tree/bst/serialize_deserialize.py)
-        - [successor：继承者](tree/bst/successor.py)
-        - [unique_bst：唯一BST](tree/bst/unique_bst.py)
-    - [deepest_left：最深叶子节点](tree/deepest_left.py)
-    - [invert_tree：反转树](tree/invert_tree.py)
-    - [is_balanced：判断平衡树](tree/is_balanced.py)
-    - [is_subtree：判断子树](tree/is_subtree.py)
-    - [is_symmetric：判断对称树](tree/is_symmetric.py)
-    - [longest_consecutive：最长连续节点](tree/longest_consecutive.py)
-    - [lowest_common_ancestor：最近公共祖先](tree/lowest_common_ancestor.py)
-    - [max_height：最大高度](tree/max_height.py)
-    - [max_path_sum：最长路径和](tree/max_path_sum.py)
-    - [min_height：最小高度](tree/min_height.py)
-    - [path_sum2：路径和2](tree/path_sum2.py)
-    - [path_sum：路径和](tree/path_sum.py)
-    - [pretty_print：完美打印](tree/pretty_print.py)
-    - [same_tree：相同树](tree/same_tree.py)
-    - [traversal：遍历](tree/traversal)
-        - [inorder：中序遍历](tree/traversal/inorder.py)
-        - [level_order：层次遍历](tree/traversal/level_order.py)
-        - [zigzag：锯齿形遍历](tree/traversal/zigzag.py)
-    - [tree：树](tree/tree.py)
-    - [trie：字典树](tree/trie)
-        - [add_and_search：添加和查找](tree/trie/add_and_search.py)
-        - [trie：字典](tree/trie/trie.py)
-- [union-find：并查集](union-find)
-    - [count_islands：岛计数](union-find/count_islands.py)
- 
+    - [2-sat：2-sat](algorithms/graph/satisfiability.py)
+    - [clone_graph：克隆图](algorithms/graph/clone_graph.py)
+    - [cycle_detection：判断圈算法](algorithms/graph/cycle_detection.py)
+    - [find_path：发现路径](algorithms/graph/find_path.py)
+    - [graph：图](algorithms/graph/graph.py)
+    - [traversal：遍历](algorithms/graph/traversal.py)
+    - [markov_chain：马尔可夫链](algorithms/graph/markov_chain.py)
+- [heap：堆](algorithms/heap)
+    - [merge_sorted_k_lists：合并k个有序链](algorithms/heap/merge_sorted_k_lists.py)
+    - [skyline：天际线](algorithms/heap/skyline.py)
+    - [sliding_window_max：滑动窗口最大值](algorithms/heap/sliding_window_max.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：倒数第k个节点](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)
+- [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)
+    - [randomized_set：随机集](algorithms/map/randomized_set.py)
+    - [valid_sudoku：有效数独](algorithms/map/valid_sudoku.py)
+- [math：数学问题](algorithms/maths)
+    - [extended_gcd：扩展欧几里得算法](algorithms/maths/extended_gcd.py)
+    - [gcd/lcm：最大公约数和最小公倍数](algorithms/maths/gcd.py)
+    - [prime_test：主要测试](algorithms/maths/prime_test.py)
+    - [primes_sieve_of_eratosthenes：埃拉托色尼的质数筛](algorithms/maths/primes_sieve_of_eratosthenes.py)
+    - [generate_strobogrammtic：生成对称数](algorithms/maths/generate_strobogrammtic.py)
+    - [is_strobogrammatic：判断对称数](algorithms/maths/is_strobogrammatic.py)
+    - [nth_digit：第n位](algorithms/maths/nth_digit.py)
+    - [rabin_miller：米勒-拉宾素性检验](algorithms/maths/rabin_miller.py)
+    - [rsa：rsa加密](algorithms/maths/rsa.py)
+    - [sqrt_precision_factor：开发精度因素](algorithms/maths/sqrt_precision_factor.py)
+    - [pythagoras：毕达哥拉斯](algorithms/maths/pythagoras.py)
+- [matrix：矩阵](algorithms/matrix)
+    - [matrix_rotation：矩阵旋转](algorithms/matrix/matrix_rotation.txt)
+    - [copy_transform：复制变换](algorithms/matrix/copy_transform.py)
+    - [bomb_enemy：炸弹人](algorithms/matrix/bomb_enemy.py)
+    - [rotate_image：旋转图像](algorithms/matrix/rotate_image.py)
+    - [sparse_dot_vector：解析点向量](algorithms/matrix/sparse_dot_vector.py)
+    - [sparse_mul：稀疏矩阵](algorithms/matrix/sparse_mul.py)
+    - [spiral_traversal：循环遍历](algorithms/matrix/spiral_traversal.py)
+    - [count_paths：计算路径](algorithms/matrix/count_paths.py)
+- [queue：队列](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)
+    - [count_elem：元素计数](algorithms/search/count_elem.py)
+    - [first_occurance：首次出现](algorithms/search/first_occurance.py)
+    - [last_occurance：最后一次出现](algorithms/search/last_occurance.py)
+- [set：集合](algorithms/set)
+    - [randomized_set：随机集合](algorithms/set/randomized_set.py)
+    - [set_covering：集合覆盖](algorithms/set/set_covering.py)
+- [sort：排序](algorithms/sort)
+    - [bubble_sort：冒泡排序](algorithms/sort/bubble_sort.py)
+    - [comb_sort：梳排序](algorithms/sort/comb_sort.py)
+    - [counting_sort：计数排序](algorithms/sort/counting_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)
+    - [quick_sort：快速排序](algorithms/sort/quick_sort.py)
+    - [selection_sort：选择排序](algorithms/sort/selection_sort.py)
+    - [sort_colors：颜色排序](algorithms/sort/sort_colors.py)
+    - [topsort：top排序](algorithms/sort/topsort.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)
+- [string：字符串](algorithms/strings)
+    - [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：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)
+- [tree：树](algorithms/tree)
+    - [segment-tree：线段树](algorithms/tree/segment_tree)
+        - [segment_tree：线段树](algorithms/tree/segment_tree/segment_tree.py)
+    - [binary_tree_paths：二叉树路径](algorithms/tree/binary_tree_paths.py)
+    - [bintree2list：二叉树转换链表](algorithms/tree/bintree2list.py)
+    - [bst：二叉搜索树](algorithms/tree/tree/bst)
+        - [array2bst：数组转换](algorithms/tree/bst/array2bst.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：二叉搜索树的第k小节点](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：唯一BST](algorithms/tree/bst/unique_bst.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_sum2：路径和2](algorithms/tree/path_sum2.py)
+    - [path_sum：路径和](algorithms/tree/path_sum.py)
+    - [pretty_print：完美打印](algorithms/tree/pretty_print.py)
+    - [same_tree：相同树](algorithms/tree/same_tree.py)
+    - [traversal：遍历](algorithms/tree/traversal)
+        - [inorder：中序遍历](algorithms/tree/traversal/inorder.py)
+        - [level_order：层次遍历](algorithms/tree/traversal/level_order.py)
+        - [zigzag：锯齿形遍历](algorithms/tree/traversal/zigzag.py)
+    - [tree：树](algorithms/tree/tree.py)
+    - [trie：字典树](algorithms/tree/trie)
+        - [add_and_search：添加和查找](algorithms/tree/trie/add_and_search.py)
+        - [trie：字典](algorithms/tree/trie/trie.py)
+- [union-find：并查集](algorithms/union-find)
+    - [count_islands：岛计数](algorithms/union-find/count_islands.py)
+
 
 ## 贡献
 谢谢主要维护人员：
@@ -284,4 +284,3 @@ pip3 uninstall -y algorithms
 * [Saad](https://github.com/SaadBenn)
 
 以及[所有贡献者](https://github.com/keon/algorithms/graphs/contributors)
-
diff --git a/README_GE.md b/README_GE.md
index af1b8b2..8258aae 100644
--- a/README_GE.md
+++ b/README_GE.md
@@ -42,11 +42,11 @@ Wenn Sie das Projekt installieren wollen, um es als Module in Ihren Projekten nu
 Sie können die Installation testen in dem Sie unten stehenden Code in eine Datei packen und ausführen.  
 
 ```python3
-from sort import merge_sort
+from algorithms.sort import merge_sort
 
 if __name__ == "__main__":
     my_list = [1, 8, 3, 5, 6]
-    my_list = merge_sort.merge_sort(my_list)
+    my_list = merge_sort(my_list)
     print(my_list)
 ```
 
@@ -59,260 +59,260 @@ Um das Projekt zu deinstallieren tippen Sie folgendes:
 
 ## Liste von Implementierungen  
 
-- [arrays](arrays)
-    - [delete_nth](arrays/delete_nth.py)
-    - [flatten](arrays/flatten.py)
-    - [garage](arrays/garage.py)
-    - [josephus_problem](arrays/josephus_problem.py)
-    - [longest_non_repeat](arrays/longest_non_repeat.py/)
-    - [merge_intervals](arrays/merge_intervals.py)
-    - [missing_ranges](arrays/missing_ranges.py)
-    - [plus_one](arrays/plus_one.py)
-    - [rotate_array](arrays/rotate_array.py)
-    - [summary_ranges](arrays/summary_ranges.py)
-    - [three_sum](arrays/three_sum.py)
-    - [two_sum](arrays/two_sum.py)
-    - [move_zeros_to_end](arrays/move_zeros_to_end.py)
-- [backtrack](backtrack)
-    - [general_solution.md](backtrack/)
-    - [anagram](backtrack/anagram.py)
-    - [array_sum_combinations](backtrack/array_sum_combinations.py)
-    - [combination_sum](backtrack/combination_sum.py)
-    - [expression_add_operators](backtrack/expression_add_operators.py)
-    - [factor_combinations](backtrack/factor_combinations.py)
-    - [generate_abbreviations](backtrack/generate_abbreviations.py)
-    - [generate_parenthesis](backtrack/generate_parenthesis.py)
-    - [letter_combination](backtrack/letter_combination.py)
-    - [palindrome_partitioning](backtrack/palindrome_partitioning.py)
-    - [pattern_match](backtrack/pattern_match.py)
-    - [permute](backtrack/permute.py)
-    - [permute_unique](backtrack/permute_unique.py)
-    - [subsets](backtrack/subsets.py)
-    - [subsets_unique](backtrack/subsets_unique.py)
-- [bfs](bfs)
-    - [shortest_distance_from_all_buildings](bfs/shortest_distance_from_all_buildings.py)
-    - [word_ladder](bfs/word_ladder.py)
-- [bit](bit)
-    - [bytes_int_conversion](bit/bytes_int_conversion.py)
-    - [count_ones](bit/count_ones.py)
-    - [find_missing_number](bit/find_missing_number.py)
-    - [power_of_two](bit/power_of_two.py)
-    - [reverse_bits](bit/reverse_bits.py)
-    - [single_number](bit/single_number.py)
-    - [single_number2](bit/single_number2.py)
-    - [single_number3](bit/single_number3.py)
-    - [subsets](bit/subsets.py)
-    - [add_bitwise_operator](bit/add_bitwise_operator.py)
-    - [bit_operation](bit/bit_operation.py)
-    - [swap_pair](bit/swap_pair.py)
-    - [find_difference](bit/find_difference.py)
-    - [has_alternative_bit](bit/has_alternative_bit.py)
-    - [insert_bit](bit/insert_bit.py)
-    - [remove_bit](bit/remove_bit.py)
-- [calculator](calculator)
-    - [math_parser](calculator/math_parser.py)
-- [dfs](dfs)
-    - [all_factors](dfs/all_factors.py)
-    - [count_islands](dfs/count_islands.py)
-    - [pacific_atlantic](dfs/pacific_atlantic.py)
-    - [sudoku_solver](dfs/sudoku_solver.py)
-    - [walls_and_gates](dfs/walls_and_gates.py)
-- [dp](dp)
-    - [buy_sell_stock](dp/buy_sell_stock.py)
-    - [climbing_stairs](dp/climbing_stairs.py)
-    - [coin_change](dp/coin_change.py)
-    - [combination_sum](dp/combination_sum.py)
-    - [egg_drop](dp/egg_drop.py)
-    - [house_robber](dp/house_robber.py)
-    - [job_scheduling](dp/job_scheduling.py)
-    - [knapsack](dp/knapsack.py)
-    - [longest_increasing](dp/longest_increasing.py)
-    - [matrix_chain_order](dp/matrix_chain_order.py)
-    - [max_product_subarray](dp/max_product_subarray.py)
-    - [max_subarray](dp/max_subarray.py)
-    - [min_cost_path](dp/min_cost_path.py)
-    - [num_decodings](dp/num_decodings.py)
-    - [regex_matching](dp/regex_matching.py)
-    - [rod_cut](dp/rod_cut.py)
-    - [word_break](dp/word_break.py)
-    - [fibonacci](dp/fib.py)
-- [graph](graph)
-    - [strongly_connected](graph/checkDiGraphStronglyConnected.py)
-    - [clone_graph](graph/clone_graph.py)
-    - [cycle_detection](graph/cycle_detection.py)
-    - [find_all_cliques](graph/find_all_cliques.py)
-    - [find_path](graph/find_path.py)
-    - [graph](graph/graph.py)
-    - [markov_chain](graph/markov_chain.py)
-    - [minimum_spanning_tree](graph/minimum_spanning_tree.py)
-    - [satisfiability](graph/satisfiability.py)
-    - [tarjan](graph/tarjan.py)
-    - [traversal](graph/traversal.py)
-- [heap](heap)
-    - [merge_sorted_k_lists](heap/merge_sorted_k_lists.py)
-    - [skyline](heap/skyline.py)
-    - [sliding_window_max](heap/sliding_window_max.py)
-    - [binary_heap](heap/binary_heap.py)
-- [linkedlist](linkedlist)
-    - [add_two_numbers](linkedlist/add_two_numbers.py)
-    - [copy_random_pointer](linkedlist/copy_random_pointer.py)
-    - [delete_node](linkedlist/delete_node.py)
-    - [first_cyclic_node](linkedlist/first_cyclic_node.py)
-    - [is_cyclic](linkedlist/is_cyclic.py)
-    - [is_palindrome](linkedlist/is_palindrome.py)
-    - [kth_to_last](linkedlist/kth_to_last.py)
-    - [linkedlist](linkedlist/linkedlist.py)
-    - [remove_duplicates](linkedlist/remove_duplicates.py)
-    - [reverse](linkedlist/reverse.py)
-    - [rotate_list](linkedlist/rotate_list.py)
-    - [swap_in_pairs](linkedlist/swap_in_pairs.py)
-    - [is_sorted](linkedlist/is_sorted.py)
-    - [remove_range](linkedlist/remove_range.py)
-- [map](map)
-    - [hashtable](map/hashtable.py)
-    - [separate_chaining_hashtable](map/separate_chaining_hashtable.py)
-    - [longest_common_subsequence](map/longest_common_subsequence.py)
-    - [randomized_set](map/randomized_set.py)
-    - [valid_sudoku](map/valid_sudoku.py)
-- [maths](maths)
-    - [base_conversion](maths/base_conversion.py)
-    - [extended_gcd](maths/extended_gcd.py)
-    - [gcd/lcm](maths/gcd.py)
-    - [generate_strobogrammtic](maths/generate_strobogrammtic.py)
-    - [is_strobogrammatic](maths/is_strobogrammatic.py)
-    - [next_bigger](maths/next_bigger.py)
-    - [next_perfect_square](maths/next_perfect_square.py)
-    - [nth_digit](maths/nth_digit.py)
-    - [prime_check](maths/prime_check.py)
-    - [primes_sieve_of_eratosthenes](maths/primes_sieve_of_eratosthenes.py)
-    - [pythagoras](maths/pythagoras.py)
-    - [rabin_miller](maths/rabin_miller.py)
-    - [rsa](maths/rsa.py)
-    - [sqrt_precision_factor](maths/sqrt_precision_factor.py)
-    - [summing_digits](maths/summing_digits.py)
-- [matrix](matrix)
-    - [sudoku_validator](matrix/sudoku_validator.py)
-    - [bomb_enemy](matrix/bomb_enemy.py)
-    - [copy_transform](matrix/copy_transform.py)
-    - [count_paths](matrix/count_paths.py)
-    - [matrix_rotation.txt](matrix/matrix_rotation.txt)
-    - [rotate_image](matrix/rotate_image.py)
-    - [search_in_sorted_matrix](matrix/search_in_sorted_matrix.py)
-    - [sparse_dot_vector](matrix/sparse_dot_vector.py)
-    - [sparse_mul](matrix/sparse_mul.py)
-    - [spiral_traversal](matrix/spiral_traversal.py)
-- [queues](queues)
-    - [max_sliding_window](queues/max_sliding_window.py)
-    - [moving_average](queues/moving_average.py)
-    - [queue](queues/queue.py)
-    - [reconstruct_queue](queues/reconstruct_queue.py)
-    - [zigzagiterator](queues/zigzagiterator.py)
-- [search](search)
-    - [binary_search](search/binary_search.py)
-    - [first_occurance](search/first_occurance.py)
-    - [last_occurance](search/last_occurance.py)
-    - [search_insert](search/search_insert.py)
-    - [two_sum](search/two_sum.py)
-    - [search_range](search/search_range.py)
-    - [find_min_rotate](search/find_min_rotate.py)
-    - [search_rotate](search/search_rotate.py)
-- [set](set)
-    - [randomized_set](set/randomized_set.py)
-    - [set_covering](set/set_covering.py)
-- [sort](sort)
-    - [bubble_sort](sort/bubble_sort.py)
-    - [comb_sort](sort/comb_sort.py)
-    - [counting_sort](sort/counting_sort.py)
-    - [heap_sort](sort/heap_sort.py)
-    - [insertion_sort](sort/insertion_sort.py)
-    - [meeting_rooms](sort/meeting_rooms.py)
-    - [merge_sort](sort/merge_sort.py)
-    - [quick_sort](sort/quick_sort.py)
-    - [selection_sort](sort/selection_sort.py)
-    - [sort_colors](sort/sort_colors.py)
-    - [topsort](sort/topsort.py)
-    - [wiggle_sort](sort/wiggle_sort.py)
-- [stack](stack)
-    - [longest_abs_path](stack/longest_abs_path.py)
-    - [simplify_path](stack/simplify_path.py)
-    - [stack](stack/stack.py)
-    - [valid_parenthesis](stack/valid_parenthesis.py)
-    - [stutter](stack/stutter.py)
-    - [switch_pairs](stack/switch_pairs.py)
-    - [is_consecutive](stack/is_consecutive.py)
-    - [remove_min](stack/remove_min.py)
-    - [is_sorted](stack/is_sorted.py)
-- [strings](strings)
-    - [fizzbuzz](strings/fizzbuzz.py)
-    - [delete_reoccurring_characters](strings/delete_reoccurring_characters.py)
-    - [strip_url_params](strings/strip_url_params.py)
-    - [validate_coordinates](strings/validate_coordinates.py)
-    - [domain_extractor](strings/domain_extractor.py)
-    - [merge_string_checker](strings/merge_string_checker.py)
-    - [add_binary](strings/add_binary.py)
-    - [breaking_bad](strings/breaking_bad.py)
-    - [decode_string](strings/decode_string.py)
-    - [encode_decode](strings/encode_decode.py)
-    - [group_anagrams](strings/group_anagrams.py)
-    - [int_to_roman](strings/int_to_roman.py)
-    - [is_palindrome](strings/is_palindrome.py)
-    - [license_number](strings/license_number.py)
-    - [make_sentence](strings/make_sentence.py)
-    - [multiply_strings](strings/multiply_strings.py)
-    - [one_edit_distance](strings/one_edit_distance.py)
-    - [rabin_karp](strings/rabin_karp.py)
-    - [reverse_string](strings/reverse_string.py)
-    - [reverse_vowel](strings/reverse_vowel.py)
-    - [reverse_words](strings/reverse_words.py)
-    - [roman_to_int](strings/roman_to_int.py)
-    - [word_squares](strings/word_squares.py)
-- [tree](tree)
-    - [bst](tree/tree/bst)
-        - [array2bst](tree/bst/array2bst.py)
-        - [bst_closest_value](tree/bst/bst_closest_value.py)
-        - [BSTIterator](tree/bst/BSTIterator.py)
-        - [delete_node](tree/bst/delete_node.py)
-        - [is_bst](tree/bst/is_bst.py)
-        - [kth_smallest](tree/bst/kth_smallest.py)
-        - [lowest_common_ancestor](tree/bst/lowest_common_ancestor.py)
-        - [predecessor](tree/bst/predecessor.py)
-        - [serialize_deserialize](tree/bst/serialize_deserialize.py)
-        - [successor](tree/bst/successor.py)
-        - [unique_bst](tree/bst/unique_bst.py)
-        - [depth_sum](tree/bst/depth_sum.py)
-        - [count_left_node](tree/bst/count_left_node.py)
-        - [num_empty](tree/bst/num_empty.py)
-        - [height](tree/bst/height.py)
-    - [red_black_tree](tree/red_black_tree)
-        - [red_black_tree](tree/red_black_tree/red_black_tree.py)
-    - [segment_tree](tree/segment_tree)
-        - [segment_tree](tree/segment_tree/segment_tree.py)
-    - [traversal](tree/traversal)
-        - [inorder](tree/traversal/inorder.py)
-        - [level_order](tree/traversal/level_order.py)
-        - [zigzag](tree/traversal/zigzag.py)
-    - [trie](tree/trie)
-        - [add_and_search](tree/trie/add_and_search.py)
-        - [trie](tree/trie/trie.py)
-    - [binary_tree_paths](tree/binary_tree_paths.py)
-    - [bintree2list](tree/bintree2list.py)
-    - [deepest_left](tree/deepest_left.py)
-    - [invert_tree](tree/invert_tree.py)
-    - [is_balanced](tree/is_balanced.py)
-    - [is_subtree](tree/is_subtree.py)
-    - [is_symmetric](tree/is_symmetric.py)
-    - [longest_consecutive](tree/longest_consecutive.py)
-    - [lowest_common_ancestor](tree/lowest_common_ancestor.py)
-    - [max_height](tree/max_height.py)
-    - [max_path_sum](tree/max_path_sum.py)
-    - [min_height](tree/min_height.py)
-    - [path_sum](tree/path_sum.py)
-    - [path_sum2](tree/path_sum2.py)
-    - [pretty_print](tree/pretty_print.py)
-    - [same_tree](tree/same_tree.py)
-    - [tree](tree/tree.py)
-- [union-find](union-find)
-    - [count_islands](union-find/count_islands.py)
+- [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_problem.py)
+    - [longest_non_repeat](algorithms/arrays/longest_non_repeat.py/)
+    - [merge_intervals](algorithms/arrays/merge_intervals.py)
+    - [missing_ranges](algorithms/arrays/missing_ranges.py)
+    - [plus_one](algorithms/arrays/plus_one.py)
+    - [rotate_array](algorithms/arrays/rotate_array.py)
+    - [summary_ranges](algorithms/arrays/summary_ranges.py)
+    - [three_sum](algorithms/arrays/three_sum.py)
+    - [two_sum](algorithms/arrays/two_sum.py)
+    - [move_zeros_to_end](algorithms/arrays/move_zeros_to_end.py)
+- [backtrack](algorithms/backtrack)
+    - [general_solution.md](algorithms/backtrack/)
+    - [anagram](algorithms/backtrack/anagram.py)
+    - [array_sum_combinations](algorithms/backtrack/array_sum_combinations.py)
+    - [combination_sum](algorithms/backtrack/combination_sum.py)
+    - [expression_add_operators](algorithms/backtrack/expression_add_operators.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)
+    - [shortest_distance_from_all_buildings](algorithms/bfs/shortest_distance_from_all_buildings.py)
+    - [word_ladder](algorithms/bfs/word_ladder.py)
+- [bit](algorithms/bit)
+    - [bytes_int_conversion](algorithms/bit/bytes_int_conversion.py)
+    - [count_ones](algorithms/bit/count_ones.py)
+    - [find_missing_number](algorithms/bit/find_missing_number.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)
+    - [add_bitwise_operator](algorithms/bit/add_bitwise_operator.py)
+    - [bit_operation](algorithms/bit/bit_operation.py)
+    - [swap_pair](algorithms/bit/swap_pair.py)
+    - [find_difference](algorithms/bit/find_difference.py)
+    - [has_alternative_bit](algorithms/bit/has_alternative_bit.py)
+    - [insert_bit](algorithms/bit/insert_bit.py)
+    - [remove_bit](algorithms/bit/remove_bit.py)
+- [calculator](algorithms/calculator)
+    - [math_parser](algorithms/calculator/math_parser.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)
+- [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)
+    - [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)
+- [graph](algorithms/graph)
+    - [strongly_connected](algorithms/graph/checkDiGraphStronglyConnected.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)
+    - [markov_chain](algorithms/graph/markov_chain.py)
+    - [minimum_spanning_tree](algorithms/graph/minimum_spanning_tree.py)
+    - [satisfiability](algorithms/graph/satisfiability.py)
+    - [tarjan](algorithms/graph/tarjan.py)
+    - [traversal](algorithms/graph/traversal.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)
+- [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)
+    - [randomized_set](algorithms/map/randomized_set.py)
+    - [valid_sudoku](algorithms/map/valid_sudoku.py)
+- [maths](algorithms/maths)
+    - [base_conversion](algorithms/maths/base_conversion.py)
+    - [extended_gcd](algorithms/maths/extended_gcd.py)
+    - [gcd/lcm](algorithms/maths/gcd.py)
+    - [generate_strobogrammtic](algorithms/maths/generate_strobogrammtic.py)
+    - [is_strobogrammatic](algorithms/maths/is_strobogrammatic.py)
+    - [next_bigger](algorithms/maths/next_bigger.py)
+    - [next_perfect_square](algorithms/maths/next_perfect_square.py)
+    - [nth_digit](algorithms/maths/nth_digit.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)
+    - [rsa](algorithms/maths/rsa.py)
+    - [sqrt_precision_factor](algorithms/maths/sqrt_precision_factor.py)
+    - [summing_digits](algorithms/maths/summing_digits.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_rotation.txt](algorithms/matrix/matrix_rotation.txt)
+    - [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)
+- [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_occurance](algorithms/search/first_occurance.py)
+    - [last_occurance](algorithms/search/last_occurance.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)
+- [set](algorithms/set)
+    - [randomized_set](algorithms/set/randomized_set.py)
+    - [set_covering](algorithms/set/set_covering.py)
+- [sort](algorithms/sort)
+    - [bubble_sort](algorithms/sort/bubble_sort.py)
+    - [comb_sort](algorithms/sort/comb_sort.py)
+    - [counting_sort](algorithms/sort/counting_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)
+    - [quick_sort](algorithms/sort/quick_sort.py)
+    - [selection_sort](algorithms/sort/selection_sort.py)
+    - [sort_colors](algorithms/sort/sort_colors.py)
+    - [topsort](algorithms/sort/topsort.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)
+- [strings](algorithms/strings)
+    - [fizzbuzz](algorithms/strings/fizzbuzz.py)
+    - [delete_reoccurring_characters](algorithms/strings/delete_reoccurring_characters.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)
+- [tree](algorithms/tree)
+    - [bst](algorithms/tree/tree/bst)
+        - [array2bst](algorithms/tree/bst/array2bst.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)
+    - [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)
+    - [traversal](algorithms/tree/traversal)
+        - [inorder](algorithms/tree/traversal/inorder.py)
+        - [level_order](algorithms/tree/traversal/level_order.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)
+    - [binary_tree_paths](algorithms/tree/binary_tree_paths.py)
+    - [bintree2list](algorithms/tree/bintree2list.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)
+- [union-find](algorithms/union-find)
+    - [count_islands](algorithms/union-find/count_islands.py)
 
 ## Mitwirkende  
 
diff --git a/algorithms/arrays/__init__.py b/algorithms/arrays/__init__.py
new file mode 100644
index 0000000..04afdb2
--- /dev/null
+++ b/algorithms/arrays/__init__.py
@@ -0,0 +1,13 @@
+from .delete_nth import *
+from .flatten import *
+from .garage import *
+from .josephus import *
+from .longest_non_repeat import *
+from .merge_intervals import *
+from .missing_ranges import *
+from .move_zeros import *
+from .plus_one import *
+from .rotate import *
+from .summarize_ranges import *
+from .three_sum import *
+from .two_sum import *
diff --git a/arrays/delete_nth.py b/algorithms/arrays/delete_nth.py
similarity index 100%
rename from arrays/delete_nth.py
rename to algorithms/arrays/delete_nth.py
diff --git a/arrays/flatten.py b/algorithms/arrays/flatten.py
similarity index 94%
rename from arrays/flatten.py
rename to algorithms/arrays/flatten.py
index 2b04746..f2eba48 100644
--- a/arrays/flatten.py
+++ b/algorithms/arrays/flatten.py
@@ -26,6 +26,6 @@ def flatten_iter(iterable):
     """
     for element in iterable:
         if isinstance(element, Iterable):
-            yield from flatten(element)
+            yield from flatten_iter(element)
         else:
             yield element
diff --git a/arrays/garage.py b/algorithms/arrays/garage.py
similarity index 100%
rename from arrays/garage.py
rename to algorithms/arrays/garage.py
diff --git a/arrays/josephus_problem.py b/algorithms/arrays/josephus.py
similarity index 100%
rename from arrays/josephus_problem.py
rename to algorithms/arrays/josephus.py
diff --git a/arrays/longest_non_repeat.py b/algorithms/arrays/longest_non_repeat.py
similarity index 94%
rename from arrays/longest_non_repeat.py
rename to algorithms/arrays/longest_non_repeat.py
index 43f2055..e97efcc 100644
--- a/arrays/longest_non_repeat.py
+++ b/algorithms/arrays/longest_non_repeat.py
@@ -10,7 +10,7 @@ Note that the answer must be a substring,
 """
 
 
-def longest_non_repeat(string):
+def longest_non_repeat_v1(string):
     """
     Finds the length of the longest substring
     without repeating characters.
@@ -27,7 +27,7 @@ def longest_non_repeat(string):
     return max_len
 
 
-def longest_non_repeat_two(string):
+def longest_non_repeat_v2(string):
     """
     Finds the length of the longest substring
     without repeating characters.
diff --git a/arrays/merge_intervals.py b/algorithms/arrays/merge_intervals.py
similarity index 98%
rename from arrays/merge_intervals.py
rename to algorithms/arrays/merge_intervals.py
index 606ca34..ee9ce60 100644
--- a/arrays/merge_intervals.py
+++ b/algorithms/arrays/merge_intervals.py
@@ -64,7 +64,7 @@ class Interval:
         print("".join(res))
 
 
-def merge_v2(intervals):
+def merge_intervals(intervals):
     """ Merges intervals in the form of list. """
     if intervals is None:
         return None
diff --git a/arrays/missing_ranges.py b/algorithms/arrays/missing_ranges.py
similarity index 100%
rename from arrays/missing_ranges.py
rename to algorithms/arrays/missing_ranges.py
diff --git a/arrays/move_zeros_to_end.py b/algorithms/arrays/move_zeros.py
similarity index 100%
rename from arrays/move_zeros_to_end.py
rename to algorithms/arrays/move_zeros.py
diff --git a/arrays/plus_one.py b/algorithms/arrays/plus_one.py
similarity index 97%
rename from arrays/plus_one.py
rename to algorithms/arrays/plus_one.py
index 9edb02f..d5bf347 100644
--- a/arrays/plus_one.py
+++ b/algorithms/arrays/plus_one.py
@@ -7,7 +7,7 @@ digit is at the head of the list.
 """
 
 
-def plus_one(digits):
+def plus_one_v1(digits):
     """
     :type digits: List[int]
     :rtype: List[int]
diff --git a/arrays/rotate_array.py b/algorithms/arrays/rotate.py
similarity index 100%
rename from arrays/rotate_array.py
rename to algorithms/arrays/rotate.py
diff --git a/arrays/summary_ranges.py b/algorithms/arrays/summarize_ranges.py
similarity index 95%
rename from arrays/summary_ranges.py
rename to algorithms/arrays/summarize_ranges.py
index 3ee3417..8cfba68 100644
--- a/arrays/summary_ranges.py
+++ b/algorithms/arrays/summarize_ranges.py
@@ -6,7 +6,7 @@ For example, given [0, 1, 2, 4, 5, 7], return [(0, 2), (4, 5), (7, 7)].
 """
 
 
-def summary_ranges(array):
+def summarize_ranges(array):
     """
     :type array: List[int]
     :rtype: List[]
diff --git a/arrays/three_sum.py b/algorithms/arrays/three_sum.py
similarity index 100%
rename from arrays/three_sum.py
rename to algorithms/arrays/three_sum.py
diff --git a/arrays/two_sum.py b/algorithms/arrays/two_sum.py
similarity index 100%
rename from arrays/two_sum.py
rename to algorithms/arrays/two_sum.py
diff --git a/backtrack/anagram.py b/algorithms/backtrack/anagram.py
similarity index 100%
rename from backtrack/anagram.py
rename to algorithms/backtrack/anagram.py
diff --git a/backtrack/array_sum_combinations.py b/algorithms/backtrack/array_sum_combinations.py
similarity index 100%
rename from backtrack/array_sum_combinations.py
rename to algorithms/backtrack/array_sum_combinations.py
diff --git a/backtrack/combination_sum.py b/algorithms/backtrack/combination_sum.py
similarity index 100%
rename from backtrack/combination_sum.py
rename to algorithms/backtrack/combination_sum.py
diff --git a/backtrack/expression_add_operators.py b/algorithms/backtrack/expression_add_operators.py
similarity index 100%
rename from backtrack/expression_add_operators.py
rename to algorithms/backtrack/expression_add_operators.py
diff --git a/backtrack/factor_combinations.py b/algorithms/backtrack/factor_combinations.py
similarity index 100%
rename from backtrack/factor_combinations.py
rename to algorithms/backtrack/factor_combinations.py
diff --git a/backtrack/general_solution.md b/algorithms/backtrack/general_solution.md
similarity index 100%
rename from backtrack/general_solution.md
rename to algorithms/backtrack/general_solution.md
diff --git a/backtrack/generate_abbreviations.py b/algorithms/backtrack/generate_abbreviations.py
similarity index 100%
rename from backtrack/generate_abbreviations.py
rename to algorithms/backtrack/generate_abbreviations.py
diff --git a/backtrack/generate_parenthesis.py b/algorithms/backtrack/generate_parenthesis.py
similarity index 100%
rename from backtrack/generate_parenthesis.py
rename to algorithms/backtrack/generate_parenthesis.py
diff --git a/backtrack/letter_combination.py b/algorithms/backtrack/letter_combination.py
similarity index 100%
rename from backtrack/letter_combination.py
rename to algorithms/backtrack/letter_combination.py
diff --git a/backtrack/palindrome_partitioning.py b/algorithms/backtrack/palindrome_partitioning.py
similarity index 100%
rename from backtrack/palindrome_partitioning.py
rename to algorithms/backtrack/palindrome_partitioning.py
diff --git a/backtrack/pattern_match.py b/algorithms/backtrack/pattern_match.py
similarity index 100%
rename from backtrack/pattern_match.py
rename to algorithms/backtrack/pattern_match.py
diff --git a/backtrack/permute.py b/algorithms/backtrack/permute.py
similarity index 100%
rename from backtrack/permute.py
rename to algorithms/backtrack/permute.py
diff --git a/backtrack/permute_unique.py b/algorithms/backtrack/permute_unique.py
similarity index 100%
rename from backtrack/permute_unique.py
rename to algorithms/backtrack/permute_unique.py
diff --git a/backtrack/subsets.py b/algorithms/backtrack/subsets.py
similarity index 100%
rename from backtrack/subsets.py
rename to algorithms/backtrack/subsets.py
diff --git a/backtrack/subsets_unique.py b/algorithms/backtrack/subsets_unique.py
similarity index 100%
rename from backtrack/subsets_unique.py
rename to algorithms/backtrack/subsets_unique.py
diff --git a/backtrack/word_search.py b/algorithms/backtrack/word_search.py
similarity index 100%
rename from backtrack/word_search.py
rename to algorithms/backtrack/word_search.py
diff --git a/bfs/shortest_distance_from_all_buildings.py b/algorithms/bfs/shortest_distance_from_all_buildings.py
similarity index 100%
rename from bfs/shortest_distance_from_all_buildings.py
rename to algorithms/bfs/shortest_distance_from_all_buildings.py
diff --git a/bfs/word_ladder.py b/algorithms/bfs/word_ladder.py
similarity index 100%
rename from bfs/word_ladder.py
rename to algorithms/bfs/word_ladder.py
diff --git a/algorithms/bit/__init__.py b/algorithms/bit/__init__.py
new file mode 100644
index 0000000..7cd175f
--- /dev/null
+++ b/algorithms/bit/__init__.py
@@ -0,0 +1,15 @@
+from .add_bitwise_operator import *
+from .count_ones import *
+from .find_missing_number import *
+from .power_of_two import *
+from .reverse_bits import *
+from .single_number import *
+from .single_number2 import *
+from .single_number3 import *
+from .subsets import *
+from .bit_operation import *
+from .swap_pair import *
+from .find_difference import *
+from .has_alternative_bit import *
+from .insert_bit import *
+from .remove_bit import *
diff --git a/bit/add_bitwise_operator.py b/algorithms/bit/add_bitwise_operator.py
similarity index 100%
rename from bit/add_bitwise_operator.py
rename to algorithms/bit/add_bitwise_operator.py
diff --git a/bit/bit_operation.py b/algorithms/bit/bit_operation.py
similarity index 100%
rename from bit/bit_operation.py
rename to algorithms/bit/bit_operation.py
diff --git a/bit/bytes_int_conversion.py b/algorithms/bit/bytes_int_conversion.py
similarity index 100%
rename from bit/bytes_int_conversion.py
rename to algorithms/bit/bytes_int_conversion.py
diff --git a/bit/count_ones.py b/algorithms/bit/count_ones.py
similarity index 100%
rename from bit/count_ones.py
rename to algorithms/bit/count_ones.py
diff --git a/bit/find_difference.py b/algorithms/bit/find_difference.py
similarity index 100%
rename from bit/find_difference.py
rename to algorithms/bit/find_difference.py
diff --git a/bit/find_missing_number.py b/algorithms/bit/find_missing_number.py
similarity index 100%
rename from bit/find_missing_number.py
rename to algorithms/bit/find_missing_number.py
diff --git a/bit/has_alternative_bit.py b/algorithms/bit/has_alternative_bit.py
similarity index 100%
rename from bit/has_alternative_bit.py
rename to algorithms/bit/has_alternative_bit.py
diff --git a/bit/insert_bit.py b/algorithms/bit/insert_bit.py
similarity index 100%
rename from bit/insert_bit.py
rename to algorithms/bit/insert_bit.py
diff --git a/bit/power_of_two.py b/algorithms/bit/power_of_two.py
similarity index 100%
rename from bit/power_of_two.py
rename to algorithms/bit/power_of_two.py
diff --git a/bit/remove_bit.py b/algorithms/bit/remove_bit.py
similarity index 100%
rename from bit/remove_bit.py
rename to algorithms/bit/remove_bit.py
diff --git a/bit/reverse_bits.py b/algorithms/bit/reverse_bits.py
similarity index 100%
rename from bit/reverse_bits.py
rename to algorithms/bit/reverse_bits.py
diff --git a/bit/single_number.py b/algorithms/bit/single_number.py
similarity index 100%
rename from bit/single_number.py
rename to algorithms/bit/single_number.py
diff --git a/bit/single_number2.py b/algorithms/bit/single_number2.py
similarity index 71%
rename from bit/single_number2.py
rename to algorithms/bit/single_number2.py
index 9aff72c..2f0e36c 100644
--- a/bit/single_number2.py
+++ b/algorithms/bit/single_number2.py
@@ -17,22 +17,6 @@ integers and mod by 3,
 the remaining should be the exact bit of the single number.
 In this way, you get the 32 bits of the single number.
 """
-def single_number(nums):
-    """
-    :type nums: List[int]
-    :rtype: int
-    """
-    res = 0
-    for i in range(0, 32):
-        count = 0
-        for num in nums:
-            if (num >> i) & 1:
-                count += 1
-        res |= ((count % 3) << i)
-    if res >= 2**31:
-        res -= 2**32
-    return res
-
 
 # Another awesome answer
 def single_number2(nums):
diff --git a/bit/single_number3.py b/algorithms/bit/single_number3.py
similarity index 100%
rename from bit/single_number3.py
rename to algorithms/bit/single_number3.py
diff --git a/bit/subsets.py b/algorithms/bit/subsets.py
similarity index 100%
rename from bit/subsets.py
rename to algorithms/bit/subsets.py
diff --git a/bit/swap_pair.py b/algorithms/bit/swap_pair.py
similarity index 100%
rename from bit/swap_pair.py
rename to algorithms/bit/swap_pair.py
diff --git a/calculator/math_parser.py b/algorithms/calculator/math_parser.py
similarity index 100%
rename from calculator/math_parser.py
rename to algorithms/calculator/math_parser.py
diff --git a/dfs/all_factors.py b/algorithms/dfs/all_factors.py
similarity index 100%
rename from dfs/all_factors.py
rename to algorithms/dfs/all_factors.py
diff --git a/dfs/count_islands.py b/algorithms/dfs/count_islands.py
similarity index 100%
rename from dfs/count_islands.py
rename to algorithms/dfs/count_islands.py
diff --git a/dfs/pacific_atlantic.py b/algorithms/dfs/pacific_atlantic.py
similarity index 100%
rename from dfs/pacific_atlantic.py
rename to algorithms/dfs/pacific_atlantic.py
diff --git a/dfs/sudoku_solver.py b/algorithms/dfs/sudoku_solver.py
similarity index 100%
rename from dfs/sudoku_solver.py
rename to algorithms/dfs/sudoku_solver.py
diff --git a/dfs/walls_and_gates.py b/algorithms/dfs/walls_and_gates.py
similarity index 100%
rename from dfs/walls_and_gates.py
rename to algorithms/dfs/walls_and_gates.py
diff --git a/dp/buy_sell_stock.py b/algorithms/dp/buy_sell_stock.py
similarity index 100%
rename from dp/buy_sell_stock.py
rename to algorithms/dp/buy_sell_stock.py
diff --git a/dp/climbing_stairs.py b/algorithms/dp/climbing_stairs.py
similarity index 100%
rename from dp/climbing_stairs.py
rename to algorithms/dp/climbing_stairs.py
diff --git a/dp/coin_change.py b/algorithms/dp/coin_change.py
similarity index 100%
rename from dp/coin_change.py
rename to algorithms/dp/coin_change.py
diff --git a/dp/combination_sum.py b/algorithms/dp/combination_sum.py
similarity index 100%
rename from dp/combination_sum.py
rename to algorithms/dp/combination_sum.py
diff --git a/dp/egg_drop.py b/algorithms/dp/egg_drop.py
similarity index 100%
rename from dp/egg_drop.py
rename to algorithms/dp/egg_drop.py
diff --git a/dp/fib.py b/algorithms/dp/fib.py
similarity index 100%
rename from dp/fib.py
rename to algorithms/dp/fib.py
diff --git a/dp/house_robber.py b/algorithms/dp/house_robber.py
similarity index 100%
rename from dp/house_robber.py
rename to algorithms/dp/house_robber.py
diff --git a/dp/job_scheduling.py b/algorithms/dp/job_scheduling.py
similarity index 100%
rename from dp/job_scheduling.py
rename to algorithms/dp/job_scheduling.py
diff --git a/dp/knapsack.py b/algorithms/dp/knapsack.py
similarity index 100%
rename from dp/knapsack.py
rename to algorithms/dp/knapsack.py
diff --git a/dp/longest_increasing.py b/algorithms/dp/longest_increasing.py
similarity index 100%
rename from dp/longest_increasing.py
rename to algorithms/dp/longest_increasing.py
diff --git a/dp/matrix_chain_order.py b/algorithms/dp/matrix_chain_order.py
similarity index 100%
rename from dp/matrix_chain_order.py
rename to algorithms/dp/matrix_chain_order.py
diff --git a/dp/max_product_subarray.py b/algorithms/dp/max_product_subarray.py
similarity index 100%
rename from dp/max_product_subarray.py
rename to algorithms/dp/max_product_subarray.py
diff --git a/dp/max_subarray.py b/algorithms/dp/max_subarray.py
similarity index 100%
rename from dp/max_subarray.py
rename to algorithms/dp/max_subarray.py
diff --git a/dp/min_cost_path.py b/algorithms/dp/min_cost_path.py
similarity index 100%
rename from dp/min_cost_path.py
rename to algorithms/dp/min_cost_path.py
diff --git a/dp/num_decodings.py b/algorithms/dp/num_decodings.py
similarity index 100%
rename from dp/num_decodings.py
rename to algorithms/dp/num_decodings.py
diff --git a/dp/regex_matching.py b/algorithms/dp/regex_matching.py
similarity index 100%
rename from dp/regex_matching.py
rename to algorithms/dp/regex_matching.py
diff --git a/dp/rod_cut.py b/algorithms/dp/rod_cut.py
similarity index 100%
rename from dp/rod_cut.py
rename to algorithms/dp/rod_cut.py
diff --git a/dp/word_break.py b/algorithms/dp/word_break.py
similarity index 100%
rename from dp/word_break.py
rename to algorithms/dp/word_break.py
diff --git a/graph/Transitive_Closure_DFS.py b/algorithms/graph/Transitive_Closure_DFS.py
similarity index 100%
rename from graph/Transitive_Closure_DFS.py
rename to algorithms/graph/Transitive_Closure_DFS.py
diff --git a/algorithms/graph/__init__.py b/algorithms/graph/__init__.py
new file mode 100644
index 0000000..bfb208e
--- /dev/null
+++ b/algorithms/graph/__init__.py
@@ -0,0 +1,1 @@
+from .tarjan import *
diff --git a/graph/checkDiGraphStronglyConnected.py b/algorithms/graph/checkDiGraphStronglyConnected.py
similarity index 100%
rename from graph/checkDiGraphStronglyConnected.py
rename to algorithms/graph/checkDiGraphStronglyConnected.py
diff --git a/graph/clone_graph.py b/algorithms/graph/clone_graph.py
similarity index 100%
rename from graph/clone_graph.py
rename to algorithms/graph/clone_graph.py
diff --git a/graph/cycle_detection.py b/algorithms/graph/cycle_detection.py
similarity index 100%
rename from graph/cycle_detection.py
rename to algorithms/graph/cycle_detection.py
diff --git a/graph/dijkstra.py b/algorithms/graph/dijkstra.py
similarity index 100%
rename from graph/dijkstra.py
rename to algorithms/graph/dijkstra.py
diff --git a/graph/find_all_cliques.py b/algorithms/graph/find_all_cliques.py
similarity index 100%
rename from graph/find_all_cliques.py
rename to algorithms/graph/find_all_cliques.py
diff --git a/graph/find_path.py b/algorithms/graph/find_path.py
similarity index 100%
rename from graph/find_path.py
rename to algorithms/graph/find_path.py
diff --git a/graph/graph.py b/algorithms/graph/graph.py
similarity index 100%
rename from graph/graph.py
rename to algorithms/graph/graph.py
diff --git a/graph/markov_chain.py b/algorithms/graph/markov_chain.py
similarity index 100%
rename from graph/markov_chain.py
rename to algorithms/graph/markov_chain.py
diff --git a/graph/minimum_spanning_tree.py b/algorithms/graph/minimum_spanning_tree.py
similarity index 100%
rename from graph/minimum_spanning_tree.py
rename to algorithms/graph/minimum_spanning_tree.py
diff --git a/graph/pathBetweenTwoVerticesInDiGraph.py b/algorithms/graph/pathBetweenTwoVerticesInDiGraph.py
similarity index 100%
rename from graph/pathBetweenTwoVerticesInDiGraph.py
rename to algorithms/graph/pathBetweenTwoVerticesInDiGraph.py
diff --git a/graph/satisfiability.py b/algorithms/graph/satisfiability.py
similarity index 100%
rename from graph/satisfiability.py
rename to algorithms/graph/satisfiability.py
diff --git a/graph/tarjan.py b/algorithms/graph/tarjan.py
similarity index 97%
rename from graph/tarjan.py
rename to algorithms/graph/tarjan.py
index 584999b..a2f44e5 100644
--- a/graph/tarjan.py
+++ b/algorithms/graph/tarjan.py
@@ -3,7 +3,7 @@ Implements Tarjan's algorithm for finding strongly connected components
 in a graph.
 https://en.wikipedia.org/wiki/Tarjan%27s_strongly_connected_components_algorithm
 """
-from graph.graph import DirectedGraph
+from algorithms.graph.graph import DirectedGraph
 
 class Tarjan(object):
     def __init__(self, dict_graph):
@@ -54,4 +54,4 @@ class Tarjan(object):
                     break
             scc.sort()
             sccs.append(scc)
-    
\ No newline at end of file
+    
diff --git a/graph/traversal.py b/algorithms/graph/traversal.py
similarity index 100%
rename from graph/traversal.py
rename to algorithms/graph/traversal.py
diff --git a/algorithms/heap/__init__.py b/algorithms/heap/__init__.py
new file mode 100644
index 0000000..3731b0e
--- /dev/null
+++ b/algorithms/heap/__init__.py
@@ -0,0 +1,3 @@
+from .binary_heap import *
+from .skyline import *
+from .sliding_window_max import *
diff --git a/heap/binary_heap.py b/algorithms/heap/binary_heap.py
similarity index 100%
rename from heap/binary_heap.py
rename to algorithms/heap/binary_heap.py
diff --git a/heap/merge_sorted_k_lists.py b/algorithms/heap/merge_sorted_k_lists.py
similarity index 100%
rename from heap/merge_sorted_k_lists.py
rename to algorithms/heap/merge_sorted_k_lists.py
diff --git a/heap/skyline.py b/algorithms/heap/skyline.py
similarity index 100%
rename from heap/skyline.py
rename to algorithms/heap/skyline.py
diff --git a/heap/sliding_window_max.py b/algorithms/heap/sliding_window_max.py
similarity index 100%
rename from heap/sliding_window_max.py
rename to algorithms/heap/sliding_window_max.py
diff --git a/algorithms/linkedlist/__init__.py b/algorithms/linkedlist/__init__.py
new file mode 100644
index 0000000..21263bf
--- /dev/null
+++ b/algorithms/linkedlist/__init__.py
@@ -0,0 +1,8 @@
+from .reverse import *
+from .is_sorted import *
+from .remove_range import *
+from .swap_in_pairs import *
+from .rotate_list import *
+from .is_cyclic import *
+from .merge_two_list import *
+from .is_palindrome import *
diff --git a/linkedlist/add_two_numbers.py b/algorithms/linkedlist/add_two_numbers.py
similarity index 100%
rename from linkedlist/add_two_numbers.py
rename to algorithms/linkedlist/add_two_numbers.py
diff --git a/linkedlist/copy_random_pointer.py b/algorithms/linkedlist/copy_random_pointer.py
similarity index 100%
rename from linkedlist/copy_random_pointer.py
rename to algorithms/linkedlist/copy_random_pointer.py
diff --git a/linkedlist/delete_node.py b/algorithms/linkedlist/delete_node.py
similarity index 100%
rename from linkedlist/delete_node.py
rename to algorithms/linkedlist/delete_node.py
diff --git a/linkedlist/first_cyclic_node.py b/algorithms/linkedlist/first_cyclic_node.py
similarity index 100%
rename from linkedlist/first_cyclic_node.py
rename to algorithms/linkedlist/first_cyclic_node.py
diff --git a/linkedlist/intersection.py b/algorithms/linkedlist/intersection.py
similarity index 100%
rename from linkedlist/intersection.py
rename to algorithms/linkedlist/intersection.py
diff --git a/linkedlist/is_cyclic.py b/algorithms/linkedlist/is_cyclic.py
similarity index 100%
rename from linkedlist/is_cyclic.py
rename to algorithms/linkedlist/is_cyclic.py
diff --git a/linkedlist/is_palindrome.py b/algorithms/linkedlist/is_palindrome.py
similarity index 100%
rename from linkedlist/is_palindrome.py
rename to algorithms/linkedlist/is_palindrome.py
diff --git a/linkedlist/is_sorted.py b/algorithms/linkedlist/is_sorted.py
similarity index 100%
rename from linkedlist/is_sorted.py
rename to algorithms/linkedlist/is_sorted.py
diff --git a/linkedlist/kth_to_last.py b/algorithms/linkedlist/kth_to_last.py
similarity index 100%
rename from linkedlist/kth_to_last.py
rename to algorithms/linkedlist/kth_to_last.py
diff --git a/linkedlist/linkedlist.py b/algorithms/linkedlist/linkedlist.py
similarity index 100%
rename from linkedlist/linkedlist.py
rename to algorithms/linkedlist/linkedlist.py
diff --git a/linkedlist/merge_two_list.py b/algorithms/linkedlist/merge_two_list.py
similarity index 100%
rename from linkedlist/merge_two_list.py
rename to algorithms/linkedlist/merge_two_list.py
diff --git a/linkedlist/partition.py b/algorithms/linkedlist/partition.py
similarity index 100%
rename from linkedlist/partition.py
rename to algorithms/linkedlist/partition.py
diff --git a/linkedlist/remove_duplicates.py b/algorithms/linkedlist/remove_duplicates.py
similarity index 100%
rename from linkedlist/remove_duplicates.py
rename to algorithms/linkedlist/remove_duplicates.py
diff --git a/linkedlist/remove_range.py b/algorithms/linkedlist/remove_range.py
similarity index 100%
rename from linkedlist/remove_range.py
rename to algorithms/linkedlist/remove_range.py
diff --git a/linkedlist/reverse.py b/algorithms/linkedlist/reverse.py
similarity index 100%
rename from linkedlist/reverse.py
rename to algorithms/linkedlist/reverse.py
diff --git a/linkedlist/rotate_list.py b/algorithms/linkedlist/rotate_list.py
similarity index 100%
rename from linkedlist/rotate_list.py
rename to algorithms/linkedlist/rotate_list.py
diff --git a/linkedlist/swap_in_pairs.py b/algorithms/linkedlist/swap_in_pairs.py
similarity index 100%
rename from linkedlist/swap_in_pairs.py
rename to algorithms/linkedlist/swap_in_pairs.py
diff --git a/map/hashtable.py b/algorithms/map/hashtable.py
similarity index 100%
rename from map/hashtable.py
rename to algorithms/map/hashtable.py
diff --git a/map/longest_common_subsequence.py b/algorithms/map/longest_common_subsequence.py
similarity index 100%
rename from map/longest_common_subsequence.py
rename to algorithms/map/longest_common_subsequence.py
diff --git a/map/randomized_set.py b/algorithms/map/randomized_set.py
similarity index 100%
rename from map/randomized_set.py
rename to algorithms/map/randomized_set.py
diff --git a/map/separate_chaining_hashtable.py b/algorithms/map/separate_chaining_hashtable.py
similarity index 100%
rename from map/separate_chaining_hashtable.py
rename to algorithms/map/separate_chaining_hashtable.py
diff --git a/map/valid_sudoku.py b/algorithms/map/valid_sudoku.py
similarity index 100%
rename from map/valid_sudoku.py
rename to algorithms/map/valid_sudoku.py
diff --git a/algorithms/maths/__init__.py b/algorithms/maths/__init__.py
new file mode 100644
index 0000000..6716384
--- /dev/null
+++ b/algorithms/maths/__init__.py
@@ -0,0 +1,11 @@
+from .base_conversion import *
+from .extended_gcd import *
+from .gcd import *
+from .generate_strobogrammtic import *
+from .is_strobogrammatic import *
+from .next_perfect_square import *
+from .prime_check import *
+from .primes_sieve_of_eratosthenes import *
+from .pythagoras import *
+from .rabin_miller import *
+from .rsa import *
diff --git a/maths/base_conversion.py b/algorithms/maths/base_conversion.py
similarity index 100%
rename from maths/base_conversion.py
rename to algorithms/maths/base_conversion.py
diff --git a/maths/extended_gcd.py b/algorithms/maths/extended_gcd.py
similarity index 100%
rename from maths/extended_gcd.py
rename to algorithms/maths/extended_gcd.py
diff --git a/maths/gcd.py b/algorithms/maths/gcd.py
similarity index 100%
rename from maths/gcd.py
rename to algorithms/maths/gcd.py
diff --git a/maths/generate_strobogrammtic.py b/algorithms/maths/generate_strobogrammtic.py
similarity index 100%
rename from maths/generate_strobogrammtic.py
rename to algorithms/maths/generate_strobogrammtic.py
diff --git a/maths/is_strobogrammatic.py b/algorithms/maths/is_strobogrammatic.py
similarity index 100%
rename from maths/is_strobogrammatic.py
rename to algorithms/maths/is_strobogrammatic.py
diff --git a/maths/next_bigger.py b/algorithms/maths/next_bigger.py
similarity index 100%
rename from maths/next_bigger.py
rename to algorithms/maths/next_bigger.py
diff --git a/maths/next_perfect_square.py b/algorithms/maths/next_perfect_square.py
similarity index 100%
rename from maths/next_perfect_square.py
rename to algorithms/maths/next_perfect_square.py
diff --git a/maths/nth_digit.py b/algorithms/maths/nth_digit.py
similarity index 100%
rename from maths/nth_digit.py
rename to algorithms/maths/nth_digit.py
diff --git a/maths/prime_check.py b/algorithms/maths/prime_check.py
similarity index 100%
rename from maths/prime_check.py
rename to algorithms/maths/prime_check.py
diff --git a/maths/primes_sieve_of_eratosthenes.py b/algorithms/maths/primes_sieve_of_eratosthenes.py
similarity index 100%
rename from maths/primes_sieve_of_eratosthenes.py
rename to algorithms/maths/primes_sieve_of_eratosthenes.py
diff --git a/maths/pythagoras.py b/algorithms/maths/pythagoras.py
similarity index 100%
rename from maths/pythagoras.py
rename to algorithms/maths/pythagoras.py
diff --git a/maths/rabin_miller.py b/algorithms/maths/rabin_miller.py
similarity index 100%
rename from maths/rabin_miller.py
rename to algorithms/maths/rabin_miller.py
diff --git a/maths/rsa.py b/algorithms/maths/rsa.py
similarity index 100%
rename from maths/rsa.py
rename to algorithms/maths/rsa.py
diff --git a/maths/sqrt_precision_factor.py b/algorithms/maths/sqrt_precision_factor.py
similarity index 100%
rename from maths/sqrt_precision_factor.py
rename to algorithms/maths/sqrt_precision_factor.py
diff --git a/maths/summing_digits.py b/algorithms/maths/summing_digits.py
similarity index 100%
rename from maths/summing_digits.py
rename to algorithms/maths/summing_digits.py
diff --git a/matrix/bomb_enemy.py b/algorithms/matrix/bomb_enemy.py
similarity index 100%
rename from matrix/bomb_enemy.py
rename to algorithms/matrix/bomb_enemy.py
diff --git a/matrix/copy_transform.py b/algorithms/matrix/copy_transform.py
similarity index 100%
rename from matrix/copy_transform.py
rename to algorithms/matrix/copy_transform.py
diff --git a/matrix/count_paths.py b/algorithms/matrix/count_paths.py
similarity index 100%
rename from matrix/count_paths.py
rename to algorithms/matrix/count_paths.py
diff --git a/matrix/matrix_rotation.txt b/algorithms/matrix/matrix_rotation.txt
similarity index 100%
rename from matrix/matrix_rotation.txt
rename to algorithms/matrix/matrix_rotation.txt
diff --git a/matrix/rotate_image.py b/algorithms/matrix/rotate_image.py
similarity index 100%
rename from matrix/rotate_image.py
rename to algorithms/matrix/rotate_image.py
diff --git a/matrix/search_in_sorted_matrix.py b/algorithms/matrix/search_in_sorted_matrix.py
similarity index 100%
rename from matrix/search_in_sorted_matrix.py
rename to algorithms/matrix/search_in_sorted_matrix.py
diff --git a/matrix/sparse_dot_vector.py b/algorithms/matrix/sparse_dot_vector.py
similarity index 100%
rename from matrix/sparse_dot_vector.py
rename to algorithms/matrix/sparse_dot_vector.py
diff --git a/matrix/sparse_mul.py b/algorithms/matrix/sparse_mul.py
similarity index 100%
rename from matrix/sparse_mul.py
rename to algorithms/matrix/sparse_mul.py
diff --git a/matrix/spiral_traversal.py b/algorithms/matrix/spiral_traversal.py
similarity index 100%
rename from matrix/spiral_traversal.py
rename to algorithms/matrix/spiral_traversal.py
diff --git a/matrix/sudoku_validator.py b/algorithms/matrix/sudoku_validator.py
similarity index 100%
rename from matrix/sudoku_validator.py
rename to algorithms/matrix/sudoku_validator.py
diff --git a/algorithms/queues/__init__.py b/algorithms/queues/__init__.py
new file mode 100644
index 0000000..3c4f22c
--- /dev/null
+++ b/algorithms/queues/__init__.py
@@ -0,0 +1,4 @@
+from .queue import *
+from .max_sliding_window import *
+from .reconstruct_queue import *
+from .priority_queue import *
diff --git a/queues/max_sliding_window.py b/algorithms/queues/max_sliding_window.py
similarity index 100%
rename from queues/max_sliding_window.py
rename to algorithms/queues/max_sliding_window.py
diff --git a/queues/moving_average.py b/algorithms/queues/moving_average.py
similarity index 100%
rename from queues/moving_average.py
rename to algorithms/queues/moving_average.py
diff --git a/queues/priority_queue.py b/algorithms/queues/priority_queue.py
similarity index 100%
rename from queues/priority_queue.py
rename to algorithms/queues/priority_queue.py
diff --git a/queues/queue.py b/algorithms/queues/queue.py
similarity index 100%
rename from queues/queue.py
rename to algorithms/queues/queue.py
diff --git a/queues/reconstruct_queue.py b/algorithms/queues/reconstruct_queue.py
similarity index 100%
rename from queues/reconstruct_queue.py
rename to algorithms/queues/reconstruct_queue.py
diff --git a/queues/zigzagiterator.py b/algorithms/queues/zigzagiterator.py
similarity index 100%
rename from queues/zigzagiterator.py
rename to algorithms/queues/zigzagiterator.py
diff --git a/algorithms/search/__init__.py b/algorithms/search/__init__.py
new file mode 100644
index 0000000..cebea34
--- /dev/null
+++ b/algorithms/search/__init__.py
@@ -0,0 +1,8 @@
+from .binary_search import *
+from .first_occurance import *
+from .last_occurance import *
+from .search_insert import *
+from .two_sum import *
+from .search_range import *
+from .find_min_rotate import *
+from .search_rotate import *
diff --git a/search/binary_search.py b/algorithms/search/binary_search.py
similarity index 100%
rename from search/binary_search.py
rename to algorithms/search/binary_search.py
diff --git a/search/find_min_rotate.py b/algorithms/search/find_min_rotate.py
similarity index 100%
rename from search/find_min_rotate.py
rename to algorithms/search/find_min_rotate.py
diff --git a/search/first_occurance.py b/algorithms/search/first_occurance.py
similarity index 100%
rename from search/first_occurance.py
rename to algorithms/search/first_occurance.py
diff --git a/search/last_occurance.py b/algorithms/search/last_occurance.py
similarity index 100%
rename from search/last_occurance.py
rename to algorithms/search/last_occurance.py
diff --git a/search/search_insert.py b/algorithms/search/search_insert.py
similarity index 100%
rename from search/search_insert.py
rename to algorithms/search/search_insert.py
diff --git a/search/search_range.py b/algorithms/search/search_range.py
similarity index 100%
rename from search/search_range.py
rename to algorithms/search/search_range.py
diff --git a/search/search_rotate.py b/algorithms/search/search_rotate.py
similarity index 100%
rename from search/search_rotate.py
rename to algorithms/search/search_rotate.py
diff --git a/search/two_sum.py b/algorithms/search/two_sum.py
similarity index 100%
rename from search/two_sum.py
rename to algorithms/search/two_sum.py
diff --git a/set/randomized_set.py b/algorithms/set/randomized_set.py
similarity index 100%
rename from set/randomized_set.py
rename to algorithms/set/randomized_set.py
diff --git a/set/set_covering.py b/algorithms/set/set_covering.py
similarity index 100%
rename from set/set_covering.py
rename to algorithms/set/set_covering.py
diff --git a/algorithms/sort/__init__.py b/algorithms/sort/__init__.py
new file mode 100644
index 0000000..20a3cf3
--- /dev/null
+++ b/algorithms/sort/__init__.py
@@ -0,0 +1,8 @@
+from .bubble_sort import *
+from .comb_sort import *
+from .counting_sort import *
+from .heap_sort import *
+from .insertion_sort import *
+from .merge_sort import *
+from .quick_sort import *
+from .selection_sort import *
diff --git a/sort/bubble_sort.py b/algorithms/sort/bubble_sort.py
similarity index 100%
rename from sort/bubble_sort.py
rename to algorithms/sort/bubble_sort.py
diff --git a/sort/comb_sort.py b/algorithms/sort/comb_sort.py
similarity index 100%
rename from sort/comb_sort.py
rename to algorithms/sort/comb_sort.py
diff --git a/sort/counting_sort.py b/algorithms/sort/counting_sort.py
similarity index 100%
rename from sort/counting_sort.py
rename to algorithms/sort/counting_sort.py
diff --git a/sort/heap_sort.py b/algorithms/sort/heap_sort.py
similarity index 100%
rename from sort/heap_sort.py
rename to algorithms/sort/heap_sort.py
diff --git a/sort/insertion_sort.py b/algorithms/sort/insertion_sort.py
similarity index 100%
rename from sort/insertion_sort.py
rename to algorithms/sort/insertion_sort.py
diff --git a/sort/meeting_rooms.py b/algorithms/sort/meeting_rooms.py
similarity index 100%
rename from sort/meeting_rooms.py
rename to algorithms/sort/meeting_rooms.py
diff --git a/sort/merge_sort.py b/algorithms/sort/merge_sort.py
similarity index 100%
rename from sort/merge_sort.py
rename to algorithms/sort/merge_sort.py
diff --git a/sort/quick_sort.py b/algorithms/sort/quick_sort.py
similarity index 100%
rename from sort/quick_sort.py
rename to algorithms/sort/quick_sort.py
diff --git a/sort/selection_sort.py b/algorithms/sort/selection_sort.py
similarity index 100%
rename from sort/selection_sort.py
rename to algorithms/sort/selection_sort.py
diff --git a/sort/sort_colors.py b/algorithms/sort/sort_colors.py
similarity index 100%
rename from sort/sort_colors.py
rename to algorithms/sort/sort_colors.py
diff --git a/sort/topsort.py b/algorithms/sort/topsort.py
similarity index 100%
rename from sort/topsort.py
rename to algorithms/sort/topsort.py
diff --git a/sort/wiggle_sort.py b/algorithms/sort/wiggle_sort.py
similarity index 100%
rename from sort/wiggle_sort.py
rename to algorithms/sort/wiggle_sort.py
diff --git a/algorithms/stack/__init__.py b/algorithms/stack/__init__.py
new file mode 100644
index 0000000..4e8d060
--- /dev/null
+++ b/algorithms/stack/__init__.py
@@ -0,0 +1,10 @@
+from .stack import *
+from .is_consecutive import *
+from .is_sorted import *
+from .remove_min import *
+from .stutter import *
+from .switch_pairs import *
+from .valid_parenthesis import *
+from .simplify_path import *
+from .stack import *
+from .ordered_stack import *
diff --git a/stack/is_consecutive.py b/algorithms/stack/is_consecutive.py
similarity index 100%
rename from stack/is_consecutive.py
rename to algorithms/stack/is_consecutive.py
diff --git a/stack/is_sorted.py b/algorithms/stack/is_sorted.py
similarity index 100%
rename from stack/is_sorted.py
rename to algorithms/stack/is_sorted.py
diff --git a/stack/longest_abs_path.py b/algorithms/stack/longest_abs_path.py
similarity index 100%
rename from stack/longest_abs_path.py
rename to algorithms/stack/longest_abs_path.py
diff --git a/stack/ordered_stack.py b/algorithms/stack/ordered_stack.py
similarity index 100%
rename from stack/ordered_stack.py
rename to algorithms/stack/ordered_stack.py
diff --git a/stack/remove_min.py b/algorithms/stack/remove_min.py
similarity index 100%
rename from stack/remove_min.py
rename to algorithms/stack/remove_min.py
diff --git a/stack/simplify_path.py b/algorithms/stack/simplify_path.py
similarity index 100%
rename from stack/simplify_path.py
rename to algorithms/stack/simplify_path.py
diff --git a/stack/stack.py b/algorithms/stack/stack.py
similarity index 100%
rename from stack/stack.py
rename to algorithms/stack/stack.py
diff --git a/stack/stutter.py b/algorithms/stack/stutter.py
similarity index 100%
rename from stack/stutter.py
rename to algorithms/stack/stutter.py
diff --git a/stack/switch_pairs.py b/algorithms/stack/switch_pairs.py
similarity index 100%
rename from stack/switch_pairs.py
rename to algorithms/stack/switch_pairs.py
diff --git a/stack/valid_parenthesis.py b/algorithms/stack/valid_parenthesis.py
similarity index 100%
rename from stack/valid_parenthesis.py
rename to algorithms/stack/valid_parenthesis.py
diff --git a/algorithms/strings/__init__.py b/algorithms/strings/__init__.py
new file mode 100644
index 0000000..b4d1bb4
--- /dev/null
+++ b/algorithms/strings/__init__.py
@@ -0,0 +1,23 @@
+from .add_binary import *
+from .breaking_bad import *
+from .decode_string import *
+from .delete_reoccurring import *
+from .domain_extractor import *
+from .encode_decode import *
+from .group_anagrams import *
+from .int_to_roman import *
+from .is_palindrome import *
+from .is_rotated import *
+from .license_number import *
+from .make_sentence import *
+from .merge_string_checker import *
+from .multiply_strings import *
+from .one_edit_distance import *
+from .rabin_karp import *
+from .reverse_string import *
+from .reverse_vowel import *
+from .reverse_words import *
+from .roman_to_int import *
+from .strip_url_params import *
+from .validate_coordinates import *
+from .word_squares import *
diff --git a/strings/add_binary.py b/algorithms/strings/add_binary.py
similarity index 100%
rename from strings/add_binary.py
rename to algorithms/strings/add_binary.py
diff --git a/strings/breaking_bad.py b/algorithms/strings/breaking_bad.py
similarity index 100%
rename from strings/breaking_bad.py
rename to algorithms/strings/breaking_bad.py
diff --git a/strings/decode_string.py b/algorithms/strings/decode_string.py
similarity index 100%
rename from strings/decode_string.py
rename to algorithms/strings/decode_string.py
diff --git a/strings/delete_reoccurring.py b/algorithms/strings/delete_reoccurring.py
similarity index 100%
rename from strings/delete_reoccurring.py
rename to algorithms/strings/delete_reoccurring.py
diff --git a/strings/domain_extractor.py b/algorithms/strings/domain_extractor.py
similarity index 100%
rename from strings/domain_extractor.py
rename to algorithms/strings/domain_extractor.py
diff --git a/strings/encode_decode.py b/algorithms/strings/encode_decode.py
similarity index 100%
rename from strings/encode_decode.py
rename to algorithms/strings/encode_decode.py
diff --git a/strings/fizzbuzz.py b/algorithms/strings/fizzbuzz.py
similarity index 100%
rename from strings/fizzbuzz.py
rename to algorithms/strings/fizzbuzz.py
diff --git a/strings/group_anagrams.py b/algorithms/strings/group_anagrams.py
similarity index 100%
rename from strings/group_anagrams.py
rename to algorithms/strings/group_anagrams.py
diff --git a/strings/int_to_roman.py b/algorithms/strings/int_to_roman.py
similarity index 100%
rename from strings/int_to_roman.py
rename to algorithms/strings/int_to_roman.py
diff --git a/strings/is_palindrome.py b/algorithms/strings/is_palindrome.py
similarity index 100%
rename from strings/is_palindrome.py
rename to algorithms/strings/is_palindrome.py
diff --git a/strings/is_rotated.py b/algorithms/strings/is_rotated.py
similarity index 100%
rename from strings/is_rotated.py
rename to algorithms/strings/is_rotated.py
diff --git a/strings/license_number.py b/algorithms/strings/license_number.py
similarity index 100%
rename from strings/license_number.py
rename to algorithms/strings/license_number.py
diff --git a/strings/make_sentence.py b/algorithms/strings/make_sentence.py
similarity index 100%
rename from strings/make_sentence.py
rename to algorithms/strings/make_sentence.py
diff --git a/strings/merge_string_checker.py b/algorithms/strings/merge_string_checker.py
similarity index 100%
rename from strings/merge_string_checker.py
rename to algorithms/strings/merge_string_checker.py
diff --git a/strings/multiply_strings.py b/algorithms/strings/multiply_strings.py
similarity index 100%
rename from strings/multiply_strings.py
rename to algorithms/strings/multiply_strings.py
diff --git a/strings/one_edit_distance.py b/algorithms/strings/one_edit_distance.py
similarity index 100%
rename from strings/one_edit_distance.py
rename to algorithms/strings/one_edit_distance.py
diff --git a/strings/rabin_karp.py b/algorithms/strings/rabin_karp.py
similarity index 100%
rename from strings/rabin_karp.py
rename to algorithms/strings/rabin_karp.py
diff --git a/strings/reverse_string.py b/algorithms/strings/reverse_string.py
similarity index 100%
rename from strings/reverse_string.py
rename to algorithms/strings/reverse_string.py
diff --git a/strings/reverse_vowel.py b/algorithms/strings/reverse_vowel.py
similarity index 100%
rename from strings/reverse_vowel.py
rename to algorithms/strings/reverse_vowel.py
diff --git a/strings/reverse_words.py b/algorithms/strings/reverse_words.py
similarity index 100%
rename from strings/reverse_words.py
rename to algorithms/strings/reverse_words.py
diff --git a/strings/roman_to_int.py b/algorithms/strings/roman_to_int.py
similarity index 100%
rename from strings/roman_to_int.py
rename to algorithms/strings/roman_to_int.py
diff --git a/strings/strip_url_params.py b/algorithms/strings/strip_url_params.py
similarity index 100%
rename from strings/strip_url_params.py
rename to algorithms/strings/strip_url_params.py
diff --git a/strings/validate_coordinates.py b/algorithms/strings/validate_coordinates.py
similarity index 100%
rename from strings/validate_coordinates.py
rename to algorithms/strings/validate_coordinates.py
diff --git a/strings/word_squares.py b/algorithms/strings/word_squares.py
similarity index 100%
rename from strings/word_squares.py
rename to algorithms/strings/word_squares.py
diff --git a/arrays/__init__.py b/algorithms/tree/avl/__init__.py
similarity index 100%
rename from arrays/__init__.py
rename to algorithms/tree/avl/__init__.py
diff --git a/tree/avl/avl.py b/algorithms/tree/avl/avl.py
similarity index 100%
rename from tree/avl/avl.py
rename to algorithms/tree/avl/avl.py
diff --git a/tree/binary_tree_paths.py b/algorithms/tree/binary_tree_paths.py
similarity index 100%
rename from tree/binary_tree_paths.py
rename to algorithms/tree/binary_tree_paths.py
diff --git a/tree/bintree2list.py b/algorithms/tree/bintree2list.py
similarity index 100%
rename from tree/bintree2list.py
rename to algorithms/tree/bintree2list.py
diff --git a/tree/bst/BSTIterator.py b/algorithms/tree/bst/BSTIterator.py
similarity index 100%
rename from tree/bst/BSTIterator.py
rename to algorithms/tree/bst/BSTIterator.py
diff --git a/tree/bst/array2bst.py b/algorithms/tree/bst/array2bst.py
similarity index 100%
rename from tree/bst/array2bst.py
rename to algorithms/tree/bst/array2bst.py
diff --git a/tree/bst/bst.py b/algorithms/tree/bst/bst.py
similarity index 100%
rename from tree/bst/bst.py
rename to algorithms/tree/bst/bst.py
diff --git a/tree/bst/bst_closest_value.py b/algorithms/tree/bst/bst_closest_value.py
similarity index 100%
rename from tree/bst/bst_closest_value.py
rename to algorithms/tree/bst/bst_closest_value.py
diff --git a/tree/bst/count_left_node.py b/algorithms/tree/bst/count_left_node.py
similarity index 100%
rename from tree/bst/count_left_node.py
rename to algorithms/tree/bst/count_left_node.py
diff --git a/tree/bst/delete_node.py b/algorithms/tree/bst/delete_node.py
similarity index 100%
rename from tree/bst/delete_node.py
rename to algorithms/tree/bst/delete_node.py
diff --git a/tree/bst/depth_sum.py b/algorithms/tree/bst/depth_sum.py
similarity index 100%
rename from tree/bst/depth_sum.py
rename to algorithms/tree/bst/depth_sum.py
diff --git a/tree/bst/height.py b/algorithms/tree/bst/height.py
similarity index 100%
rename from tree/bst/height.py
rename to algorithms/tree/bst/height.py
diff --git a/tree/bst/is_bst.py b/algorithms/tree/bst/is_bst.py
similarity index 100%
rename from tree/bst/is_bst.py
rename to algorithms/tree/bst/is_bst.py
diff --git a/tree/bst/kth_smallest.py b/algorithms/tree/bst/kth_smallest.py
similarity index 100%
rename from tree/bst/kth_smallest.py
rename to algorithms/tree/bst/kth_smallest.py
diff --git a/tree/bst/lowest_common_ancestor.py b/algorithms/tree/bst/lowest_common_ancestor.py
similarity index 100%
rename from tree/bst/lowest_common_ancestor.py
rename to algorithms/tree/bst/lowest_common_ancestor.py
diff --git a/tree/bst/num_empty.py b/algorithms/tree/bst/num_empty.py
similarity index 100%
rename from tree/bst/num_empty.py
rename to algorithms/tree/bst/num_empty.py
diff --git a/tree/bst/predecessor.py b/algorithms/tree/bst/predecessor.py
similarity index 100%
rename from tree/bst/predecessor.py
rename to algorithms/tree/bst/predecessor.py
diff --git a/tree/bst/serialize_deserialize.py b/algorithms/tree/bst/serialize_deserialize.py
similarity index 100%
rename from tree/bst/serialize_deserialize.py
rename to algorithms/tree/bst/serialize_deserialize.py
diff --git a/tree/bst/successor.py b/algorithms/tree/bst/successor.py
similarity index 100%
rename from tree/bst/successor.py
rename to algorithms/tree/bst/successor.py
diff --git a/tree/bst/unique_bst.py b/algorithms/tree/bst/unique_bst.py
similarity index 100%
rename from tree/bst/unique_bst.py
rename to algorithms/tree/bst/unique_bst.py
diff --git a/tree/deepest_left.py b/algorithms/tree/deepest_left.py
similarity index 100%
rename from tree/deepest_left.py
rename to algorithms/tree/deepest_left.py
diff --git a/tree/invert_tree.py b/algorithms/tree/invert_tree.py
similarity index 100%
rename from tree/invert_tree.py
rename to algorithms/tree/invert_tree.py
diff --git a/tree/is_balanced.py b/algorithms/tree/is_balanced.py
similarity index 100%
rename from tree/is_balanced.py
rename to algorithms/tree/is_balanced.py
diff --git a/tree/is_subtree.py b/algorithms/tree/is_subtree.py
similarity index 100%
rename from tree/is_subtree.py
rename to algorithms/tree/is_subtree.py
diff --git a/tree/is_symmetric.py b/algorithms/tree/is_symmetric.py
similarity index 100%
rename from tree/is_symmetric.py
rename to algorithms/tree/is_symmetric.py
diff --git a/tree/longest_consecutive.py b/algorithms/tree/longest_consecutive.py
similarity index 100%
rename from tree/longest_consecutive.py
rename to algorithms/tree/longest_consecutive.py
diff --git a/tree/lowest_common_ancestor.py b/algorithms/tree/lowest_common_ancestor.py
similarity index 100%
rename from tree/lowest_common_ancestor.py
rename to algorithms/tree/lowest_common_ancestor.py
diff --git a/tree/max_height.py b/algorithms/tree/max_height.py
similarity index 100%
rename from tree/max_height.py
rename to algorithms/tree/max_height.py
diff --git a/tree/max_path_sum.py b/algorithms/tree/max_path_sum.py
similarity index 100%
rename from tree/max_path_sum.py
rename to algorithms/tree/max_path_sum.py
diff --git a/tree/min_height.py b/algorithms/tree/min_height.py
similarity index 100%
rename from tree/min_height.py
rename to algorithms/tree/min_height.py
diff --git a/tree/path_sum.py b/algorithms/tree/path_sum.py
similarity index 100%
rename from tree/path_sum.py
rename to algorithms/tree/path_sum.py
diff --git a/tree/path_sum2.py b/algorithms/tree/path_sum2.py
similarity index 100%
rename from tree/path_sum2.py
rename to algorithms/tree/path_sum2.py
diff --git a/tree/pretty_print.py b/algorithms/tree/pretty_print.py
similarity index 100%
rename from tree/pretty_print.py
rename to algorithms/tree/pretty_print.py
diff --git a/tree/red_black_tree/red_black_tree.py b/algorithms/tree/red_black_tree/red_black_tree.py
similarity index 100%
rename from tree/red_black_tree/red_black_tree.py
rename to algorithms/tree/red_black_tree/red_black_tree.py
diff --git a/tree/same_tree.py b/algorithms/tree/same_tree.py
similarity index 100%
rename from tree/same_tree.py
rename to algorithms/tree/same_tree.py
diff --git a/tree/segment_tree/segment_tree.py b/algorithms/tree/segment_tree/segment_tree.py
similarity index 100%
rename from tree/segment_tree/segment_tree.py
rename to algorithms/tree/segment_tree/segment_tree.py
diff --git a/tree/traversal/inorder.py b/algorithms/tree/traversal/inorder.py
similarity index 100%
rename from tree/traversal/inorder.py
rename to algorithms/tree/traversal/inorder.py
diff --git a/tree/traversal/level_order.py b/algorithms/tree/traversal/level_order.py
similarity index 100%
rename from tree/traversal/level_order.py
rename to algorithms/tree/traversal/level_order.py
diff --git a/tree/traversal/zigzag.py b/algorithms/tree/traversal/zigzag.py
similarity index 100%
rename from tree/traversal/zigzag.py
rename to algorithms/tree/traversal/zigzag.py
diff --git a/tree/tree.py b/algorithms/tree/tree.py
similarity index 100%
rename from tree/tree.py
rename to algorithms/tree/tree.py
diff --git a/tree/trie/add_and_search.py b/algorithms/tree/trie/add_and_search.py
similarity index 100%
rename from tree/trie/add_and_search.py
rename to algorithms/tree/trie/add_and_search.py
diff --git a/tree/trie/trie.py b/algorithms/tree/trie/trie.py
similarity index 100%
rename from tree/trie/trie.py
rename to algorithms/tree/trie/trie.py
diff --git a/union-find/count_islands.py b/algorithms/union-find/count_islands.py
similarity index 100%
rename from union-find/count_islands.py
rename to algorithms/union-find/count_islands.py
diff --git a/bit/__init__.py b/bit/__init__.py
deleted file mode 100644
index e69de29..0000000
diff --git a/graph/__init__.py b/graph/__init__.py
deleted file mode 100644
index e69de29..0000000
diff --git a/heap/__init__.py b/heap/__init__.py
deleted file mode 100644
index e69de29..0000000
diff --git a/linkedlist/__init__.py b/linkedlist/__init__.py
deleted file mode 100644
index e69de29..0000000
diff --git a/maths/__init__.py b/maths/__init__.py
deleted file mode 100644
index e69de29..0000000
diff --git a/queues/__init__.py b/queues/__init__.py
deleted file mode 100644
index 2b5cb8a..0000000
--- a/queues/__init__.py
+++ /dev/null
@@ -1,1 +0,0 @@
-from .queue import *
diff --git a/search/__init__.py b/search/__init__.py
deleted file mode 100644
index e69de29..0000000
diff --git a/sort/__init__.py b/sort/__init__.py
deleted file mode 100644
index e69de29..0000000
diff --git a/stack/__init__.py b/stack/__init__.py
deleted file mode 100644
index 843a758..0000000
--- a/stack/__init__.py
+++ /dev/null
@@ -1,1 +0,0 @@
-from .stack import *


Test patch:
diff --git a/tests/test_array.py b/tests/test_array.py
index acae483..88cf591 100644
--- a/tests/test_array.py
+++ b/tests/test_array.py
@@ -1,16 +1,16 @@
-from arrays.delete_nth import delete_nth, delete_nth_naive
-from arrays.flatten import flatten, flatten_iter
-from arrays.garage import garage
-from arrays.josephus_problem import josephus
-from arrays.longest_non_repeat import longest_non_repeat, longest_non_repeat_two
-from arrays.merge_intervals import Interval, merge_v2
-from arrays.missing_ranges import missing_ranges
-from arrays.move_zeros_to_end import move_zeros
-from arrays.plus_one import plus_one, plus_one_v2, plus_one_v3
-from arrays.rotate_array import rotate_v1, rotate_v2, rotate_v3
-from arrays.summary_ranges import summary_ranges
-from arrays.three_sum import three_sum
-from arrays.two_sum import two_sum
+from algorithms.arrays import delete_nth, delete_nth_naive
+from algorithms.arrays import flatten, flatten_iter
+from algorithms.arrays import garage
+from algorithms.arrays import josephus
+from algorithms.arrays import longest_non_repeat_v1, longest_non_repeat_v2
+from algorithms.arrays import Interval, merge_intervals
+from algorithms.arrays import missing_ranges
+from algorithms.arrays import move_zeros
+from algorithms.arrays import plus_one_v1, plus_one_v2, plus_one_v3
+from algorithms.arrays import rotate_v1, rotate_v2, rotate_v3
+from algorithms.arrays import summarize_ranges
+from algorithms.arrays import three_sum
+from algorithms.arrays import two_sum
 
 import unittest
 
@@ -37,15 +37,19 @@ class TestDeleteNth(unittest.TestCase):
 
     def test_delete_nth_naive(self):
 
-        self.assertListEqual(delete_nth_naive([20, 37, 20, 21, 37, 21, 21], n=1),
+        self.assertListEqual(delete_nth_naive(
+                             [20, 37, 20, 21, 37, 21, 21], n=1),
                              [20, 37, 21])
-        self.assertListEqual(delete_nth_naive([1, 1, 3, 3, 7, 2, 2, 2, 2], n=3),
+        self.assertListEqual(delete_nth_naive(
+                             [1, 1, 3, 3, 7, 2, 2, 2, 2], n=3),
                              [1, 1, 3, 3, 7, 2, 2, 2])
-        self.assertListEqual(delete_nth_naive([1, 2, 3, 1, 1, 2, 1, 2, 3, 3, 2, 4, 5, 3, 1], n=3),
+        self.assertListEqual(delete_nth_naive(
+                             [1, 2, 3, 1, 1, 2, 1, 2, 3, 3, 2, 4, 5, 3, 1], n=3),
                              [1, 2, 3, 1, 1, 2, 2, 3, 3, 4, 5])
         self.assertListEqual(delete_nth_naive([], n=5),
                              [])
-        self.assertListEqual(delete_nth_naive([1, 2, 3, 1, 1, 2, 1, 2, 3, 3, 2, 4, 5, 3, 1], n=0),
+        self.assertListEqual(delete_nth_naive(
+                             [1, 2, 3, 1, 1, 2, 1, 2, 3, 3, 2, 4, 5, 3, 1], n=0),
                              [])
 
     def test_delete_nth(self):
@@ -117,32 +121,35 @@ class TestGarage(unittest.TestCase):
         steps, seq = garage(initial, final)
 
         self.assertEqual(steps, 4)
-        self.assertListEqual(seq, [[0, 2, 3, 1, 4], [2, 0, 3, 1, 4], [2, 3, 0, 1, 4], [0, 3, 2, 1, 4]])
+        self.assertListEqual(seq, [[0, 2, 3, 1, 4],
+                                   [2, 0, 3, 1, 4],
+                                   [2, 3, 0, 1, 4],
+                                   [0, 3, 2, 1, 4]])
 
 
 class TestLongestNonRepeat(unittest.TestCase):
 
-    def test_longest_non_repeat(self):
+    def test_longest_non_repeat_v1(self):
 
         string = "abcabcbb"
-        self.assertEqual(longest_non_repeat(string), 3)
+        self.assertEqual(longest_non_repeat_v1(string), 3)
 
         string = "bbbbb"
-        self.assertEqual(longest_non_repeat(string), 1)
+        self.assertEqual(longest_non_repeat_v1(string), 1)
 
         string = "pwwkew"
-        self.assertEqual(longest_non_repeat(string), 3)
+        self.assertEqual(longest_non_repeat_v1(string), 3)
 
-    def test_longest_non_repeat_two(self):
+    def test_longest_non_repeat_v2(self):
 
         string = "abcabcbb"
-        self.assertEqual(longest_non_repeat_two(string), 3)
+        self.assertEqual(longest_non_repeat_v2(string), 3)
 
         string = "bbbbb"
-        self.assertEqual(longest_non_repeat_two(string), 1)
+        self.assertEqual(longest_non_repeat_v2(string), 1)
 
         string = "pwwkew"
-        self.assertEqual(longest_non_repeat_two(string), 3)
+        self.assertEqual(longest_non_repeat_v2(string), 3)
 
 
 class TestMergeInterval(unittest.TestCase):
@@ -156,9 +163,9 @@ class TestMergeInterval(unittest.TestCase):
             [Interval(1, 6), Interval(8, 10), Interval(15, 18)]
         )
 
-    def test_merge_v2(self):
+    def test_merge_intervals(self):
         interval_list = [[1, 3], [2, 6], [8, 10], [15, 18]]
-        merged_intervals = merge_v2(interval_list)
+        merged_intervals = merge_intervals(interval_list)
         self.assertEqual(
             merged_intervals,
             [[1, 6], [8, 10], [15, 18]]
@@ -172,7 +179,8 @@ class TestMissingRanges(unittest.TestCase):
         arr = [3, 5, 10, 11, 12, 15, 19]
 
         self.assertListEqual(missing_ranges(arr, 0, 20),
-                             [(0, 2), (4, 4), (6, 9), (13, 14), (16, 18), (20, 20)])
+                             [(0, 2), (4, 4), (6, 9),
+                              (13, 14), (16, 18), (20, 20)])
 
         self.assertListEqual(missing_ranges(arr, 6, 100),
                              [(6, 9), (13, 14), (16, 18), (20, 100)])
@@ -191,64 +199,79 @@ class TestMoveZeros(unittest.TestCase):
 
 class TestPlusOne(unittest.TestCase):
 
-    def test_plus_one(self):
+    def test_plus_one_v1(self):
 
-        self.assertListEqual(plus_one([0]), [1])
-        self.assertListEqual(plus_one([9]), [1, 0])
-        self.assertListEqual(plus_one([1, 0, 9]), [1, 1, 0])
-        self.assertListEqual(plus_one([9, 9, 8, 0, 0, 9]), [9, 9, 8, 0, 1, 0])
-        self.assertListEqual(plus_one([9, 9, 9, 9]), [1, 0, 0, 0, 0])
+        self.assertListEqual(plus_one_v1([0]), [1])
+        self.assertListEqual(plus_one_v1([9]), [1, 0])
+        self.assertListEqual(plus_one_v1([1, 0, 9]), [1, 1, 0])
+        self.assertListEqual(plus_one_v1([9, 9, 8, 0, 0, 9]),
+                             [9, 9, 8, 0, 1, 0])
+        self.assertListEqual(plus_one_v1([9, 9, 9, 9]),
+                             [1, 0, 0, 0, 0])
 
     def test_plus_one_v2(self):
 
         self.assertListEqual(plus_one_v2([0]), [1])
         self.assertListEqual(plus_one_v2([9]), [1, 0])
         self.assertListEqual(plus_one_v2([1, 0, 9]), [1, 1, 0])
-        self.assertListEqual(plus_one_v2([9, 9, 8, 0, 0, 9]), [9, 9, 8, 0, 1, 0])
-        self.assertListEqual(plus_one_v2([9, 9, 9, 9]), [1, 0, 0, 0, 0])
+        self.assertListEqual(plus_one_v2([9, 9, 8, 0, 0, 9]),
+                             [9, 9, 8, 0, 1, 0])
+        self.assertListEqual(plus_one_v2([9, 9, 9, 9]),
+                             [1, 0, 0, 0, 0])
 
     def test_plus_one_v3(self):
 
         self.assertListEqual(plus_one_v3([0]), [1])
         self.assertListEqual(plus_one_v3([9]), [1, 0])
         self.assertListEqual(plus_one_v3([1, 0, 9]), [1, 1, 0])
-        self.assertListEqual(plus_one_v3([9, 9, 8, 0, 0, 9]), [9, 9, 8, 0, 1, 0])
-        self.assertListEqual(plus_one_v3([9, 9, 9, 9]), [1, 0, 0, 0, 0])
+        self.assertListEqual(plus_one_v3([9, 9, 8, 0, 0, 9]),
+                             [9, 9, 8, 0, 1, 0])
+        self.assertListEqual(plus_one_v3([9, 9, 9, 9]),
+                             [1, 0, 0, 0, 0])
 
 
 class TestRotateArray(unittest.TestCase):
 
     def test_rotate_v1(self):
 
-        self.assertListEqual(rotate_v1([1, 2, 3, 4, 5, 6, 7], k=3), [5, 6, 7, 1, 2, 3, 4])
-        self.assertListEqual(rotate_v1([1, 2, 3, 4, 5, 6, 7], k=1), [7, 1, 2, 3, 4, 5, 6])
-        self.assertListEqual(rotate_v1([1, 2, 3, 4, 5, 6, 7], k=7), [1, 2, 3, 4, 5, 6, 7])
+        self.assertListEqual(rotate_v1([1, 2, 3, 4, 5, 6, 7], k=3),
+                                       [5, 6, 7, 1, 2, 3, 4])
+        self.assertListEqual(rotate_v1([1, 2, 3, 4, 5, 6, 7], k=1),
+                                       [7, 1, 2, 3, 4, 5, 6])
+        self.assertListEqual(rotate_v1([1, 2, 3, 4, 5, 6, 7], k=7),
+                                       [1, 2, 3, 4, 5, 6, 7])
         self.assertListEqual(rotate_v1([1, 2], k=111), [2, 1])
 
     def test_rotate_v2(self):
 
-        self.assertListEqual(rotate_v2([1, 2, 3, 4, 5, 6, 7], k=3), [5, 6, 7, 1, 2, 3, 4])
-        self.assertListEqual(rotate_v2([1, 2, 3, 4, 5, 6, 7], k=1), [7, 1, 2, 3, 4, 5, 6])
-        self.assertListEqual(rotate_v2([1, 2, 3, 4, 5, 6, 7], k=7), [1, 2, 3, 4, 5, 6, 7])
+        self.assertListEqual(rotate_v2([1, 2, 3, 4, 5, 6, 7], k=3),
+                                       [5, 6, 7, 1, 2, 3, 4])
+        self.assertListEqual(rotate_v2([1, 2, 3, 4, 5, 6, 7], k=1),
+                                       [7, 1, 2, 3, 4, 5, 6])
+        self.assertListEqual(rotate_v2([1, 2, 3, 4, 5, 6, 7], k=7),
+                                       [1, 2, 3, 4, 5, 6, 7])
         self.assertListEqual(rotate_v2([1, 2], k=111), [2, 1])
 
     def test_rotate_v3(self):
 
-        self.assertListEqual(rotate_v3([1, 2, 3, 4, 5, 6, 7], k=3), [5, 6, 7, 1, 2, 3, 4])
-        self.assertListEqual(rotate_v3([1, 2, 3, 4, 5, 6, 7], k=1), [7, 1, 2, 3, 4, 5, 6])
-        self.assertListEqual(rotate_v3([1, 2, 3, 4, 5, 6, 7], k=7), [1, 2, 3, 4, 5, 6, 7])
+        self.assertListEqual(rotate_v3([1, 2, 3, 4, 5, 6, 7], k=3),
+                                       [5, 6, 7, 1, 2, 3, 4])
+        self.assertListEqual(rotate_v3([1, 2, 3, 4, 5, 6, 7], k=1),
+                                       [7, 1, 2, 3, 4, 5, 6])
+        self.assertListEqual(rotate_v3([1, 2, 3, 4, 5, 6, 7], k=7),
+                                       [1, 2, 3, 4, 5, 6, 7])
         self.assertListEqual(rotate_v3([1, 2], k=111), [2, 1])
 
 
 class TestSummaryRanges(unittest.TestCase):
 
-    def test_summary_ranges(self):
+    def test_summarize_ranges(self):
 
-        self.assertListEqual(summary_ranges([0, 1, 2, 4, 5, 7]),
+        self.assertListEqual(summarize_ranges([0, 1, 2, 4, 5, 7]),
                              [(0, 2), (4, 5), (7, 7)])
-        self.assertListEqual(summary_ranges([-5, -4, -3, 1, 2, 4, 5, 6]),
+        self.assertListEqual(summarize_ranges([-5, -4, -3, 1, 2, 4, 5, 6]),
                              [(-5, -3), (1, 2), (4, 6)])
-        self.assertListEqual(summary_ranges([-2, -1, 0, 1, 2]),
+        self.assertListEqual(summarize_ranges([-2, -1, 0, 1, 2]),
                              [(-2, 2)])
 
 
diff --git a/tests/test_bit.py b/tests/test_bit.py
index 33d80d9..01290c2 100644
--- a/tests/test_bit.py
+++ b/tests/test_bit.py
@@ -1,18 +1,20 @@
-from bit.add_bitwise_operator import add_bitwise_operator
-from bit.count_ones import count_ones_iter, count_ones_recur
-from bit.find_missing_number import find_missing_number, find_missing_number2
-from bit.power_of_two import is_power_of_two
-from bit.reverse_bits import reverse_bits
-from bit.single_number import single_number
-from bit.single_number2 import single_number2
-from bit.single_number3 import single_number3
-from bit.subsets import subsets
-from bit.bit_operation import get_bit, set_bit, clear_bit, update_bit
-from bit.swap_pair import swap_pair
-from bit.find_difference import find_difference
-from bit.has_alternative_bit import has_alternative_bit, has_alternative_bit_fast
-from bit.insert_bit import insert_one_bit, insert_mult_bits
-from bit.remove_bit import remove_bit
+from algorithms.bit import (
+    add_bitwise_operator,
+    count_ones_iter, count_ones_recur,
+    find_missing_number, find_missing_number2,
+    is_power_of_two,
+    reverse_bits,
+    single_number,
+    single_number2,
+    single_number3,
+    subsets,
+    get_bit, set_bit, clear_bit, update_bit,
+    swap_pair,
+    find_difference,
+    has_alternative_bit, has_alternative_bit_fast,
+    insert_one_bit, insert_mult_bits,
+    remove_bit
+)
 
 import unittest
 import random
diff --git a/tests/test_graph.py b/tests/test_graph.py
index e62a102..63937db 100644
--- a/tests/test_graph.py
+++ b/tests/test_graph.py
@@ -1,4 +1,4 @@
-from graph.tarjan import Tarjan
+from algorithms.graph import Tarjan
 
 import unittest
 
@@ -41,4 +41,4 @@ class TestTarjan(unittest.TestCase):
         }
 
         g = Tarjan(example)
-        self.assertEqual(g.sccs, [['A', 'B', 'E'], ['C', 'D'], ['F', 'G'], ['H']])
\ No newline at end of file
+        self.assertEqual(g.sccs, [['A', 'B', 'E'], ['C', 'D'], ['F', 'G'], ['H']])
diff --git a/tests/test_heap.py b/tests/test_heap.py
index c6f2c7e..0925972 100644
--- a/tests/test_heap.py
+++ b/tests/test_heap.py
@@ -1,6 +1,8 @@
-from heap.binary_heap import BinaryHeap
-from heap.skyline import get_skyline
-from heap.sliding_window_max import max_sliding_window
+from algorithms.heap import (
+    BinaryHeap,
+    get_skyline,
+    max_sliding_window
+)
 
 import unittest
 
diff --git a/tests/test_linkedlist.py b/tests/test_linkedlist.py
index 89096bc..435ac72 100644
--- a/tests/test_linkedlist.py
+++ b/tests/test_linkedlist.py
@@ -1,11 +1,13 @@
-from linkedlist.reverse import reverse_list, reverse_list_recursive
-from linkedlist.is_sorted import is_sorted
-from linkedlist.remove_range import remove_range
-from linkedlist.swap_in_pairs import swap_pairs
-from linkedlist.rotate_list import rotate_right
-from linkedlist.is_cyclic import is_cyclic
-from linkedlist.merge_two_list import merge_two_list, merge_two_list_recur
-from linkedlist.is_palindrome import is_palindrome, is_palindrome_stack, is_palindrome_dict
+from algorithms.linkedlist import (
+    reverse_list, reverse_list_recursive,
+    is_sorted,
+    remove_range,
+    swap_pairs,
+    rotate_right,
+    is_cyclic,
+    merge_two_list, merge_two_list_recur,
+    is_palindrome, is_palindrome_stack, is_palindrome_dict
+)
 
 import unittest
 
diff --git a/tests/test_maths.py b/tests/test_maths.py
index a7567f7..afafd2e 100644
--- a/tests/test_maths.py
+++ b/tests/test_maths.py
@@ -1,14 +1,16 @@
-from maths.base_conversion import int2base, base2int
-from maths.extended_gcd import extended_gcd
-from maths.gcd import gcd, lcm
-from maths.generate_strobogrammtic import gen_strobogrammatic, strobogrammatic_in_range
-from maths.is_strobogrammatic import is_strobogrammatic, is_strobogrammatic2
-from maths.next_perfect_square import find_next_square, find_next_square2
-from maths.prime_check import prime_check, prime_check2
-from maths.primes_sieve_of_eratosthenes import primes
-from maths.pythagoras import pythagoras
-from maths.rabin_miller import is_prime
-from maths.rsa import encrypt, decrypt, generate_key
+from algorithms.maths import (
+    int2base, base2int,
+    extended_gcd,
+    gcd, lcm,
+    gen_strobogrammatic, strobogrammatic_in_range,
+    is_strobogrammatic, is_strobogrammatic2,
+    find_next_square, find_next_square2,
+    prime_check, prime_check2,
+    primes,
+    pythagoras,
+    is_prime,
+    encrypt, decrypt, generate_key
+)
 
 import unittest
 
diff --git a/tests/test_queues.py b/tests/test_queues.py
index a37d95f..e5a882a 100644
--- a/tests/test_queues.py
+++ b/tests/test_queues.py
@@ -1,7 +1,10 @@
-from queues.queue import ArrayQueue, LinkedListQueue
-from queues.max_sliding_window import max_sliding_window
-from queues.reconstruct_queue import reconstruct_queue
-from queues.priority_queue import PriorityQueue, PriorityQueueNode
+from algorithms.queues import (
+    ArrayQueue, LinkedListQueue,
+    max_sliding_window,
+    reconstruct_queue,
+    PriorityQueue, PriorityQueueNode
+)
+
 import unittest
 
 class TestQueue(unittest.TestCase):
diff --git a/tests/test_search.py b/tests/test_search.py
index ca55940..4567ec5 100644
--- a/tests/test_search.py
+++ b/tests/test_search.py
@@ -1,11 +1,13 @@
-from search.binary_search import binary_search, binary_search_recur
-from search.first_occurance import first_occurance
-from search.last_occurance import last_occurance
-from search.search_insert import search_insert
-from search.two_sum import two_sum, two_sum1, two_sum2
-from search.search_range import search_range
-from search.find_min_rotate import find_min_rotate, find_min_rotate_recur
-from search.search_rotate import search_rotate, search_rotate_recur
+from algorithms.search import (
+    binary_search, binary_search_recur,
+    first_occurance,
+    last_occurance,
+    search_insert,
+    two_sum, two_sum1, two_sum2,
+    search_range,
+    find_min_rotate, find_min_rotate_recur,
+    search_rotate, search_rotate_recur
+)
 
 import unittest
 
diff --git a/tests/test_sort.py b/tests/test_sort.py
index 30f2762..07d13c8 100644
--- a/tests/test_sort.py
+++ b/tests/test_sort.py
@@ -1,11 +1,13 @@
-from sort.bubble_sort import bubble_sort
-from sort.comb_sort import comb_sort
-from sort.counting_sort import counting_sort
-from sort.heap_sort import max_heap_sort, min_heap_sort
-from sort.insertion_sort import insertion_sort
-from sort.merge_sort import merge_sort
-from sort.quick_sort import quick_sort
-from sort.selection_sort import selection_sort
+from algorithms.sort import (
+    bubble_sort,
+    comb_sort,
+    counting_sort,
+    max_heap_sort, min_heap_sort,
+    insertion_sort,
+    merge_sort,
+    quick_sort,
+    selection_sort
+)
 
 import unittest
 
diff --git a/tests/test_stack.py b/tests/test_stack.py
index e3b85d4..d04b27f 100644
--- a/tests/test_stack.py
+++ b/tests/test_stack.py
@@ -1,12 +1,14 @@
-from stack.is_consecutive import first_is_consecutive, second_is_consecutive
-from stack.is_sorted import is_sorted
-from stack.remove_min import remove_min
-from stack.stutter import first_stutter, second_stutter
-from stack.switch_pairs import first_switch_pairs, second_switch_pairs
-from stack.valid_parenthesis import is_valid
-from stack.simplify_path import simplify_path
-from stack.stack import ArrayStack, LinkedListStack
-from stack.ordered_stack import OrderedStack
+from algorithms.stack import (
+    first_is_consecutive, second_is_consecutive,
+    is_sorted,
+    remove_min,
+    first_stutter, second_stutter,
+    first_switch_pairs, second_switch_pairs,
+    is_valid,
+    simplify_path,
+    ArrayStack, LinkedListStack,
+    OrderedStack
+)
 
 import unittest
 class TestSuite(unittest.TestCase):
diff --git a/tests/test_strings.py b/tests/test_strings.py
index c0aa283..31e0d3e 100644
--- a/tests/test_strings.py
+++ b/tests/test_strings.py
@@ -1,27 +1,30 @@
-from strings.add_binary import add_binary
-from strings.breaking_bad import match_symbol, match_symbol_1, bracket
-from strings.decode_string import decode_string
-from strings.delete_reoccurring import delete_reoccurring_characters
-from strings.domain_extractor import domain_name_1, domain_name_2
-from strings.encode_decode import encode, decode
-from strings.group_anagrams import group_anagrams
-from strings.int_to_roman import int_to_roman
-from strings.is_palindrome import is_palindrome, is_palindrome_reverse, \
-is_palindrome_two_pointer, is_palindrome_stack
-from strings.is_rotated import is_rotated
-from strings.license_number import license_number
-from strings.make_sentence import make_sentence
-from strings.merge_string_checker import is_merge_recursive, is_merge_iterative
-from strings.multiply_strings import multiply
-from strings.one_edit_distance import is_one_edit, is_one_edit2
-from strings.rabin_karp import rabin_karp
-from strings.reverse_string import *
-from strings.reverse_vowel import reverse_vowel
-from strings.reverse_words import reverse_words
-from strings.roman_to_int import roman_to_int
-from strings.strip_url_params import *
-from strings.validate_coordinates import *
-from strings.word_squares import word_squares
+from algorithms.strings import (
+    add_binary,
+    match_symbol, match_symbol_1, bracket,
+    decode_string,
+    delete_reoccurring_characters,
+    domain_name_1, domain_name_2,
+    encode, decode,
+    group_anagrams,
+    int_to_roman,
+    is_palindrome, is_palindrome_reverse,
+    is_palindrome_two_pointer, is_palindrome_stack,
+    is_rotated,
+    license_number,
+    make_sentence,
+    is_merge_recursive, is_merge_iterative,
+    multiply,
+    is_one_edit, is_one_edit2,
+    rabin_karp,
+    ultra_pythonic, iterative, recursive, pythonic,
+    reverse_vowel,
+    reverse_words,
+    roman_to_int,
+    strip_url_params1, strip_url_params2, strip_url_params3,
+    is_valid_coordinates_0, is_valid_coordinates_1,
+    is_valid_coordinates_regular_expression,
+    word_squares
+)
 
 import unittest
 
@@ -380,4 +383,4 @@ class TestWordSquares(unittest.TestCase):
 
 
 if __name__ == "__main__":
-    unittest.main()
\ No newline at end of file
+    unittest.main()