Repository: keon/algorithms
Pull request #288 (2018-05-29 22:46:38)

Reorganize the algorithms
PR to reorganize the algorithms

- [ ] Need to merge this PR #286  first


Patch:
diff --git a/README.md b/README.md
index fce6c05..1f518e6 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)
 ```
 
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/bit/__init__.py b/algorithms/tree/avl/__init__.py
similarity index 100%
rename from bit/__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/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_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()