├── .gitignore ├── NOTES.txt ├── README.md ├── arrays_and_strings ├── __init__.py ├── highest_product_of_three.py ├── length_longest_substring_two_distinct.py ├── length_of_longest_substring.py ├── max_area_of_island.py ├── missing_ranges.py ├── one_away.py ├── partition_equal_subset_sum.py ├── permutations.py ├── set_matrix_zeroes.py └── toolbox │ ├── __init__.py │ ├── bottom_up.py │ ├── greedy_algo.py │ ├── sorting.py │ └── top_down.py ├── dijkstra.py ├── dynamic_programming ├── .paint_fill.py.swp ├── README.md ├── __init__.py ├── house_robber.py ├── making_change.py ├── min_making_change.go ├── primitive_calculator │ └── primitive_calculator.py ├── problem_solving.md ├── robot_paths.py ├── smart_thief.py └── staircase.py ├── graphs_and_trees ├── __init__.py ├── adjacency_list.py ├── adjacency_matrix.py ├── adjacency_set.py ├── algorithms │ ├── __init__.py │ ├── convert_sorted_array_to_balanced_bst.py │ ├── convert_sorted_linked_list_to_balanced_bst.py │ ├── max_depth.py │ ├── min_depth.py │ ├── random_contraction.py │ ├── strongly_connected_components.py │ ├── symetric_tree.py │ ├── upside_down_binary_tree.py │ └── validate_binary_search_tree.py ├── bfs.py ├── binary_tree.py ├── dfs.py ├── heap.py ├── prims_algorithm.py ├── problem_set │ ├── __init__.py │ ├── is_binary_tree_balanced.py │ └── is_binary_tree_valid.py ├── tests │ ├── __init__.py │ ├── test_prims_algorithm.py │ └── test_trees.py └── trie.py ├── hash_table ├── __init__.py ├── hash_table.py ├── map.py └── tests │ └── test_hash_table.py ├── linked_list ├── __init__.py ├── linked_list.py ├── palindrome_check.py └── tests │ ├── __init__.py │ └── test_linked_list.py ├── search ├── binary_search │ ├── __init__.py │ └── binary_search.py └── tests │ └── test_binary_search.py ├── sorting ├── __init__.py ├── bubble_sort.py ├── insertion_sort.py ├── merge_sort.py ├── quick_sort.py ├── selection_sort.py ├── shell_sort.py └── tests │ ├── __init__.py │ └── test_sorting_algos.py ├── stacks_queues ├── __init__.py └── priority_queue.py └── utils ├── __init__.py └── decorators.py /.gitignore: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/johnshiver/algorithms/HEAD/.gitignore -------------------------------------------------------------------------------- /NOTES.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/johnshiver/algorithms/HEAD/NOTES.txt -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/johnshiver/algorithms/HEAD/README.md -------------------------------------------------------------------------------- /arrays_and_strings/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /arrays_and_strings/highest_product_of_three.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/johnshiver/algorithms/HEAD/arrays_and_strings/highest_product_of_three.py -------------------------------------------------------------------------------- /arrays_and_strings/length_longest_substring_two_distinct.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/johnshiver/algorithms/HEAD/arrays_and_strings/length_longest_substring_two_distinct.py -------------------------------------------------------------------------------- /arrays_and_strings/length_of_longest_substring.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/johnshiver/algorithms/HEAD/arrays_and_strings/length_of_longest_substring.py -------------------------------------------------------------------------------- /arrays_and_strings/max_area_of_island.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/johnshiver/algorithms/HEAD/arrays_and_strings/max_area_of_island.py -------------------------------------------------------------------------------- /arrays_and_strings/missing_ranges.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/johnshiver/algorithms/HEAD/arrays_and_strings/missing_ranges.py -------------------------------------------------------------------------------- /arrays_and_strings/one_away.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/johnshiver/algorithms/HEAD/arrays_and_strings/one_away.py -------------------------------------------------------------------------------- /arrays_and_strings/partition_equal_subset_sum.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/johnshiver/algorithms/HEAD/arrays_and_strings/partition_equal_subset_sum.py -------------------------------------------------------------------------------- /arrays_and_strings/permutations.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/johnshiver/algorithms/HEAD/arrays_and_strings/permutations.py -------------------------------------------------------------------------------- /arrays_and_strings/set_matrix_zeroes.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/johnshiver/algorithms/HEAD/arrays_and_strings/set_matrix_zeroes.py -------------------------------------------------------------------------------- /arrays_and_strings/toolbox/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /arrays_and_strings/toolbox/bottom_up.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/johnshiver/algorithms/HEAD/arrays_and_strings/toolbox/bottom_up.py -------------------------------------------------------------------------------- /arrays_and_strings/toolbox/greedy_algo.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/johnshiver/algorithms/HEAD/arrays_and_strings/toolbox/greedy_algo.py -------------------------------------------------------------------------------- /arrays_and_strings/toolbox/sorting.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/johnshiver/algorithms/HEAD/arrays_and_strings/toolbox/sorting.py -------------------------------------------------------------------------------- /arrays_and_strings/toolbox/top_down.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/johnshiver/algorithms/HEAD/arrays_and_strings/toolbox/top_down.py -------------------------------------------------------------------------------- /dijkstra.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/johnshiver/algorithms/HEAD/dijkstra.py -------------------------------------------------------------------------------- /dynamic_programming/.paint_fill.py.swp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/johnshiver/algorithms/HEAD/dynamic_programming/.paint_fill.py.swp -------------------------------------------------------------------------------- /dynamic_programming/README.md: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/johnshiver/algorithms/HEAD/dynamic_programming/README.md -------------------------------------------------------------------------------- /dynamic_programming/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /dynamic_programming/house_robber.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/johnshiver/algorithms/HEAD/dynamic_programming/house_robber.py -------------------------------------------------------------------------------- /dynamic_programming/making_change.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/johnshiver/algorithms/HEAD/dynamic_programming/making_change.py -------------------------------------------------------------------------------- /dynamic_programming/min_making_change.go: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/johnshiver/algorithms/HEAD/dynamic_programming/min_making_change.go -------------------------------------------------------------------------------- /dynamic_programming/primitive_calculator/primitive_calculator.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/johnshiver/algorithms/HEAD/dynamic_programming/primitive_calculator/primitive_calculator.py -------------------------------------------------------------------------------- /dynamic_programming/problem_solving.md: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /dynamic_programming/robot_paths.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/johnshiver/algorithms/HEAD/dynamic_programming/robot_paths.py -------------------------------------------------------------------------------- /dynamic_programming/smart_thief.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/johnshiver/algorithms/HEAD/dynamic_programming/smart_thief.py -------------------------------------------------------------------------------- /dynamic_programming/staircase.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/johnshiver/algorithms/HEAD/dynamic_programming/staircase.py -------------------------------------------------------------------------------- /graphs_and_trees/__init__.py: -------------------------------------------------------------------------------- 1 | from .adjacency_list import Graph, Vertex 2 | -------------------------------------------------------------------------------- /graphs_and_trees/adjacency_list.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/johnshiver/algorithms/HEAD/graphs_and_trees/adjacency_list.py -------------------------------------------------------------------------------- /graphs_and_trees/adjacency_matrix.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/johnshiver/algorithms/HEAD/graphs_and_trees/adjacency_matrix.py -------------------------------------------------------------------------------- /graphs_and_trees/adjacency_set.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/johnshiver/algorithms/HEAD/graphs_and_trees/adjacency_set.py -------------------------------------------------------------------------------- /graphs_and_trees/algorithms/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /graphs_and_trees/algorithms/convert_sorted_array_to_balanced_bst.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/johnshiver/algorithms/HEAD/graphs_and_trees/algorithms/convert_sorted_array_to_balanced_bst.py -------------------------------------------------------------------------------- /graphs_and_trees/algorithms/convert_sorted_linked_list_to_balanced_bst.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/johnshiver/algorithms/HEAD/graphs_and_trees/algorithms/convert_sorted_linked_list_to_balanced_bst.py -------------------------------------------------------------------------------- /graphs_and_trees/algorithms/max_depth.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/johnshiver/algorithms/HEAD/graphs_and_trees/algorithms/max_depth.py -------------------------------------------------------------------------------- /graphs_and_trees/algorithms/min_depth.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/johnshiver/algorithms/HEAD/graphs_and_trees/algorithms/min_depth.py -------------------------------------------------------------------------------- /graphs_and_trees/algorithms/random_contraction.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/johnshiver/algorithms/HEAD/graphs_and_trees/algorithms/random_contraction.py -------------------------------------------------------------------------------- /graphs_and_trees/algorithms/strongly_connected_components.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/johnshiver/algorithms/HEAD/graphs_and_trees/algorithms/strongly_connected_components.py -------------------------------------------------------------------------------- /graphs_and_trees/algorithms/symetric_tree.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/johnshiver/algorithms/HEAD/graphs_and_trees/algorithms/symetric_tree.py -------------------------------------------------------------------------------- /graphs_and_trees/algorithms/upside_down_binary_tree.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/johnshiver/algorithms/HEAD/graphs_and_trees/algorithms/upside_down_binary_tree.py -------------------------------------------------------------------------------- /graphs_and_trees/algorithms/validate_binary_search_tree.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/johnshiver/algorithms/HEAD/graphs_and_trees/algorithms/validate_binary_search_tree.py -------------------------------------------------------------------------------- /graphs_and_trees/bfs.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/johnshiver/algorithms/HEAD/graphs_and_trees/bfs.py -------------------------------------------------------------------------------- /graphs_and_trees/binary_tree.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/johnshiver/algorithms/HEAD/graphs_and_trees/binary_tree.py -------------------------------------------------------------------------------- /graphs_and_trees/dfs.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/johnshiver/algorithms/HEAD/graphs_and_trees/dfs.py -------------------------------------------------------------------------------- /graphs_and_trees/heap.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/johnshiver/algorithms/HEAD/graphs_and_trees/heap.py -------------------------------------------------------------------------------- /graphs_and_trees/prims_algorithm.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/johnshiver/algorithms/HEAD/graphs_and_trees/prims_algorithm.py -------------------------------------------------------------------------------- /graphs_and_trees/problem_set/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /graphs_and_trees/problem_set/is_binary_tree_balanced.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/johnshiver/algorithms/HEAD/graphs_and_trees/problem_set/is_binary_tree_balanced.py -------------------------------------------------------------------------------- /graphs_and_trees/problem_set/is_binary_tree_valid.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/johnshiver/algorithms/HEAD/graphs_and_trees/problem_set/is_binary_tree_valid.py -------------------------------------------------------------------------------- /graphs_and_trees/tests/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/johnshiver/algorithms/HEAD/graphs_and_trees/tests/__init__.py -------------------------------------------------------------------------------- /graphs_and_trees/tests/test_prims_algorithm.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/johnshiver/algorithms/HEAD/graphs_and_trees/tests/test_prims_algorithm.py -------------------------------------------------------------------------------- /graphs_and_trees/tests/test_trees.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/johnshiver/algorithms/HEAD/graphs_and_trees/tests/test_trees.py -------------------------------------------------------------------------------- /graphs_and_trees/trie.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/johnshiver/algorithms/HEAD/graphs_and_trees/trie.py -------------------------------------------------------------------------------- /hash_table/__init__.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | # -*- coding: utf-8 -*- 3 | -------------------------------------------------------------------------------- /hash_table/hash_table.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/johnshiver/algorithms/HEAD/hash_table/hash_table.py -------------------------------------------------------------------------------- /hash_table/map.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/johnshiver/algorithms/HEAD/hash_table/map.py -------------------------------------------------------------------------------- /hash_table/tests/test_hash_table.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/johnshiver/algorithms/HEAD/hash_table/tests/test_hash_table.py -------------------------------------------------------------------------------- /linked_list/__init__.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | # -*- coding: utf-8 -*- 3 | -------------------------------------------------------------------------------- /linked_list/linked_list.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/johnshiver/algorithms/HEAD/linked_list/linked_list.py -------------------------------------------------------------------------------- /linked_list/palindrome_check.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /linked_list/tests/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /linked_list/tests/test_linked_list.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/johnshiver/algorithms/HEAD/linked_list/tests/test_linked_list.py -------------------------------------------------------------------------------- /search/binary_search/__init__.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | # -*- coding: utf-8 -*- 3 | -------------------------------------------------------------------------------- /search/binary_search/binary_search.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/johnshiver/algorithms/HEAD/search/binary_search/binary_search.py -------------------------------------------------------------------------------- /search/tests/test_binary_search.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/johnshiver/algorithms/HEAD/search/tests/test_binary_search.py -------------------------------------------------------------------------------- /sorting/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/johnshiver/algorithms/HEAD/sorting/__init__.py -------------------------------------------------------------------------------- /sorting/bubble_sort.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/johnshiver/algorithms/HEAD/sorting/bubble_sort.py -------------------------------------------------------------------------------- /sorting/insertion_sort.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/johnshiver/algorithms/HEAD/sorting/insertion_sort.py -------------------------------------------------------------------------------- /sorting/merge_sort.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/johnshiver/algorithms/HEAD/sorting/merge_sort.py -------------------------------------------------------------------------------- /sorting/quick_sort.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/johnshiver/algorithms/HEAD/sorting/quick_sort.py -------------------------------------------------------------------------------- /sorting/selection_sort.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/johnshiver/algorithms/HEAD/sorting/selection_sort.py -------------------------------------------------------------------------------- /sorting/shell_sort.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/johnshiver/algorithms/HEAD/sorting/shell_sort.py -------------------------------------------------------------------------------- /sorting/tests/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /sorting/tests/test_sorting_algos.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/johnshiver/algorithms/HEAD/sorting/tests/test_sorting_algos.py -------------------------------------------------------------------------------- /stacks_queues/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/johnshiver/algorithms/HEAD/stacks_queues/__init__.py -------------------------------------------------------------------------------- /stacks_queues/priority_queue.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/johnshiver/algorithms/HEAD/stacks_queues/priority_queue.py -------------------------------------------------------------------------------- /utils/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /utils/decorators.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/johnshiver/algorithms/HEAD/utils/decorators.py --------------------------------------------------------------------------------