From 3ff848eff8d0d3e4f6a25756816fafc4f9a360a5 Mon Sep 17 00:00:00 2001 From: hendurhance Date: Sat, 14 Jan 2023 17:06:17 +0100 Subject: [PATCH 1/7] =?UTF-8?q?Rewrite=20README.md=20Documentation=20?= =?UTF-8?q?=E2=9C=8D=F0=9F=8F=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.md | 38 ++++++++++++++- automate.py | 57 ++++++++++++++++++++++ queue/__pycache__/__init__.cpython-39.pyc | Bin 0 -> 169 bytes queue/__pycache__/queue.cpython-39.pyc | Bin 0 -> 3904 bytes 4 files changed, 93 insertions(+), 2 deletions(-) create mode 100644 automate.py create mode 100644 queue/__pycache__/__init__.cpython-39.pyc create mode 100644 queue/__pycache__/queue.cpython-39.pyc diff --git a/README.md b/README.md index a8d764f..7bc4e25 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,37 @@ -# Books +# Algorithm in Python -this Repo contains solutions to different sorting algorithms written in python +This project contains various common algorithms implemented in Python for learning purposes. The algorithms are organized into different categories: + +## Table of Content +| Category | Algorithm | +|------------------|----------------------------------------------------------------------------------------| +| Array | [Circular Counter](https://github.com/DSC-Unilag/Algorithms/blob/master/array/circular_counter.py)
[Flatten](https://github.com/DSC-Unilag/Algorithms/blob/master/array/flatten.py)
[Garage](https://github.com/DSC-Unilag/Algorithms/blob/master/array/garage.py)
[Longest Non Repeat](https://github.com/DSC-Unilag/Algorithms/blob/master/array/longest_non_repeat.py)
[Merge Intervals](https://github.com/DSC-Unilag/Algorithms/blob/master/array/merge_intervals.py)
[Missing Ranges](https://github.com/DSC-Unilag/Algorithms/blob/master/array/missing_ranges.py)
[Plus One](https://github.com//algorithm-in-python/tree/master/array/plus_one.py)
[Rotate Array](https://github.com/DSC-Unilag/Algorithms/blob/master/array/rotate_array.py)
[Summary Ranges](https://github.com/DSC-Unilag/Algorithms/blob/master/array/summary_ranges.py)
[Three Sum](https://github.com/DSC-Unilag/Algorithms/blob/master/array/three_sum.py)
[Two Sum](https://github.com/DSC-Unilag/Algorithms/blob/master/array/two_sum.py) | +| Backtrack | [Anagram](https://github.com/DSC-Unilag/Algorithms/blob/master/backtrack/anagram.py)
[Array Sum Combinations](https://github.com/DSC-Unilag/Algorithms/blob/master/backtrack/array_sum_combinations.py)
[Combination Sum](https://github.com/DSC-Unilag/Algorithms/blob/master/backtrack/combination_sum.py)
[Expression Add Operators](https://github.com/DSC-Unilag/Algorithms/blob/master/backtrack/expression_add_operators.py)
[Factor Combinations](https://github.com/DSC-Unilag/Algorithms/blob/master/backtrack/factor_combinations.py)
[General Solution](https://github.com/DSC-Unilag/Algorithms/blob/master/backtrack/general_solution.md)
[Generate Abbreviations](https://github.com/DSC-Unilag/Algorithms/blob/master/backtrack/generate_abbreviations.py)
[Generate Parenthesis](https://github.com//algorithm-in-python/) + + +# Test +| Category | Algorithm | +|------------------|----------------------------------------------------------------------------------------| +| Array | [Circular Counter](https://github.com/DSC-Unilag/Algorithms/blob/master/array/circular_counter.py)
[Flatten](https://github.com/DSC-Unilag/Algorithms/blob/master/array/flatten.py)
[Garage](https://github.com/DSC-Unilag/Algorithms/blob/master/array/garage.py)
[Longest Non Repeat](https://github.com/DSC-Unilag/Algorithms/blob/master/array/longest_non_repeat.py)
[Merge Intervals](https://github.com/DSC-Unilag/Algorithms/blob/master/array/merge_intervals.py)
[Missing Ranges](https://github.com/DSC-Unilag/Algorithms/blob/master/array/missing_ranges.py)
[Plus One](https://github.com/DSC-Unilag/Algorithms/blob/master/array/plus_one.py)
[Rotate Array](https://github.com/DSC-Unilag/Algorithms/blob/master/array/rotate_array.py)
[Summary Ranges](https://github.com/DSC-Unilag/Algorithms/blob/master/array/summary_ranges.py)
[Three Sum](https://github.com/DSC-Unilag/Algorithms/blob/master/array/three_sum.py)
[Two Sum](https://github.com/DSC-Unilag/Algorithms/blob/master/array/two_sum.py)
| +| Backtrack | [Anagram](https://github.com/DSC-Unilag/Algorithms/blob/master/backtrack/anagram.py)
[Array Sum Combinations](https://github.com/DSC-Unilag/Algorithms/blob/master/backtrack/array_sum_combinations.py)
[Combination Sum](https://github.com/DSC-Unilag/Algorithms/blob/master/backtrack/combination_sum.py)
[Expression Add Operators](https://github.com/DSC-Unilag/Algorithms/blob/master/backtrack/expression_add_operators.py)
[Factor Combinations](https://github.com/DSC-Unilag/Algorithms/blob/master/backtrack/factor_combinations.py)
[General Solution.Md](https://github.com/DSC-Unilag/Algorithms/blob/master/backtrack/general_solution.md)
[Generate Abbreviations](https://github.com/DSC-Unilag/Algorithms/blob/master/backtrack/generate_abbreviations.py)
[Generate Parenthesis](https://github.com/DSC-Unilag/Algorithms/blob/master/backtrack/generate_parenthesis.py)
[Letter Combination](https://github.com/DSC-Unilag/Algorithms/blob/master/backtrack/letter_combination.py)
[Palindrome Partitioning](https://github.com/DSC-Unilag/Algorithms/blob/master/backtrack/palindrome_partitioning.py)
[Pattern Match](https://github.com/DSC-Unilag/Algorithms/blob/master/backtrack/pattern_match.py)
[Permute](https://github.com/DSC-Unilag/Algorithms/blob/master/backtrack/permute.py)
[Permute Unique](https://github.com/DSC-Unilag/Algorithms/blob/master/backtrack/permute_unique.py)
[Subsets](https://github.com/DSC-Unilag/Algorithms/blob/master/backtrack/subsets.py)
[Subsets Unique](https://github.com/DSC-Unilag/Algorithms/blob/master/backtrack/subsets_unique.py)
[Word Search](https://github.com/DSC-Unilag/Algorithms/blob/master/backtrack/word_search.py)
| +| BFS | [Shortest Distance From All Buildings](https://github.com/DSC-Unilag/Algorithms/blob/master/bfs/shortest_distance_from_all_buildings.py)
[Word Ladder](https://github.com/DSC-Unilag/Algorithms/blob/master/bfs/word_ladder.py)
| +| Bit | [Add Without Operator](https://github.com/DSC-Unilag/Algorithms/blob/master/bit/add_without_operator.py)
[Bytes Int Conversion](https://github.com/DSC-Unilag/Algorithms/blob/master/bit/bytes_int_conversion.py)
[Count Ones](https://github.com/DSC-Unilag/Algorithms/blob/master/bit/count_ones.py)
[Find Missing Number](https://github.com/DSC-Unilag/Algorithms/blob/master/bit/find_missing_number.py)
[Power Of Two](https://github.com/DSC-Unilag/Algorithms/blob/master/bit/power_of_two.py)
[Reverse Bits](https://github.com/DSC-Unilag/Algorithms/blob/master/bit/reverse_bits.py)
[Single Number](https://github.com/DSC-Unilag/Algorithms/blob/master/bit/single_number.py)
[Single Number2](https://github.com/DSC-Unilag/Algorithms/blob/master/bit/single_number2.py)
[Subsets](https://github.com/DSC-Unilag/Algorithms/blob/master/bit/subsets.py)
| +| Calculator | [Math Parser](https://github.com/DSC-Unilag/Algorithms/blob/master/calculator/math_parser.py)
| +| Design | [Lrucache.Md](https://github.com/DSC-Unilag/Algorithms/blob/master/design/LRUcache.md)
[Alarm System.Md](https://github.com/DSC-Unilag/Algorithms/blob/master/design/alarm_system.md)
[All O One Ds.Md](https://github.com/DSC-Unilag/Algorithms/blob/master/design/all_o_one_ds.md)
[Calculator.Md](https://github.com/DSC-Unilag/Algorithms/blob/master/design/calculator.md)
[Excel Table.Md](https://github.com/DSC-Unilag/Algorithms/blob/master/design/excel_table.md)
[Nearby Drivers.Md](https://github.com/DSC-Unilag/Algorithms/blob/master/design/nearby_drivers.md)
[Ride Sharing.Md](https://github.com/DSC-Unilag/Algorithms/blob/master/design/ride_sharing.md)
[Task Runner.Md](https://github.com/DSC-Unilag/Algorithms/blob/master/design/task_runner.md)
[Twitter Feeds.Md](https://github.com/DSC-Unilag/Algorithms/blob/master/design/twitter_feeds.md)
| +| DFS | [All Factors](https://github.com/DSC-Unilag/Algorithms/blob/master/dfs/all_factors.py)
[Count Islands](https://github.com/DSC-Unilag/Algorithms/blob/master/dfs/count_islands.py)
[Pacific Atlantic](https://github.com/DSC-Unilag/Algorithms/blob/master/dfs/pacific_atlantic.py)
[Sudoku Solver](https://github.com/DSC-Unilag/Algorithms/blob/master/dfs/sudoku_solver.py)
[Walls And Gates](https://github.com/DSC-Unilag/Algorithms/blob/master/dfs/walls_and_gates.py)
| +| DP | [Buy Sell Stock](https://github.com/DSC-Unilag/Algorithms/blob/master/dp/buy_sell_stock.py)
[Climbing Stairs](https://github.com/DSC-Unilag/Algorithms/blob/master/dp/climbing_stairs.py)
[Combination Sum](https://github.com/DSC-Unilag/Algorithms/blob/master/dp/combination_sum.py)
[House Robber](https://github.com/DSC-Unilag/Algorithms/blob/master/dp/house_robber.py)
[Knapsack](https://github.com/DSC-Unilag/Algorithms/blob/master/dp/knapsack.py)
[Longest Increasing](https://github.com/DSC-Unilag/Algorithms/blob/master/dp/longest_increasing.py)
[Max Product Subarray](https://github.com/DSC-Unilag/Algorithms/blob/master/dp/max_product_subarray.py)
[Max Subarray](https://github.com/DSC-Unilag/Algorithms/blob/master/dp/max_subarray.py)
[Num Decodings](https://github.com/DSC-Unilag/Algorithms/blob/master/dp/num_decodings.py)
[Regex Matching](https://github.com/DSC-Unilag/Algorithms/blob/master/dp/regex_matching.py)
[Word Break](https://github.com/DSC-Unilag/Algorithms/blob/master/dp/word_break.py)
| +| Graph | [Clone Graph](https://github.com/DSC-Unilag/Algorithms/blob/master/graph/clone_graph.py)
[Cycle Detection](https://github.com/DSC-Unilag/Algorithms/blob/master/graph/cycle_detection.py)
[Find Path](https://github.com/DSC-Unilag/Algorithms/blob/master/graph/find_path.py)
[Graph](https://github.com/DSC-Unilag/Algorithms/blob/master/graph/graph.py)
[Traversal](https://github.com/DSC-Unilag/Algorithms/blob/master/graph/traversal.py)
| +| Heap | [Merge Sorted K Lists](https://github.com/DSC-Unilag/Algorithms/blob/master/heap/merge_sorted_k_lists.py)
[Skyline](https://github.com/DSC-Unilag/Algorithms/blob/master/heap/skyline.py)
[Sliding Window Max](https://github.com/DSC-Unilag/Algorithms/blob/master/heap/sliding_window_max.py)
| +| Linked List | [Add Two Numbers](https://github.com/DSC-Unilag/Algorithms/blob/master/linkedlist/add_two_numbers.py)
[Copy Random Pointer](https://github.com/DSC-Unilag/Algorithms/blob/master/linkedlist/copy_random_pointer.py)
[Delete Node](https://github.com/DSC-Unilag/Algorithms/blob/master/linkedlist/delete_node.py)
[First Cyclic Node](https://github.com/DSC-Unilag/Algorithms/blob/master/linkedlist/first_cyclic_node.py)
[Is Cyclic](https://github.com/DSC-Unilag/Algorithms/blob/master/linkedlist/is_cyclic.py)
[Is Palindrome](https://github.com/DSC-Unilag/Algorithms/blob/master/linkedlist/is_palindrome.py)
[Kth To Last](https://github.com/DSC-Unilag/Algorithms/blob/master/linkedlist/kth_to_last.py)
[Linkedlist](https://github.com/DSC-Unilag/Algorithms/blob/master/linkedlist/linkedlist.py)
[Remove Duplicates](https://github.com/DSC-Unilag/Algorithms/blob/master/linkedlist/remove_duplicates.py)
[Reverse](https://github.com/DSC-Unilag/Algorithms/blob/master/linkedlist/reverse.py)
[Rotate List](https://github.com/DSC-Unilag/Algorithms/blob/master/linkedlist/rotate_list.py)
[Swap In Pairs](https://github.com/DSC-Unilag/Algorithms/blob/master/linkedlist/swap_in_pairs.py)
| +| Map | [Hashtable](https://github.com/DSC-Unilag/Algorithms/blob/master/map/hashtable.py)
[Longest Common Subsequence](https://github.com/DSC-Unilag/Algorithms/blob/master/map/longest_common_subsequence.py)
[Randomized Set](https://github.com/DSC-Unilag/Algorithms/blob/master/map/randomized_set.py)
[Valid Sudoku](https://github.com/DSC-Unilag/Algorithms/blob/master/map/valid_sudoku.py)
| +| Math | [Extended Gcd](https://github.com/DSC-Unilag/Algorithms/blob/master/math/extended_gcd.py)
[Gcd](https://github.com/DSC-Unilag/Algorithms/blob/master/math/gcd.py)
[Generate Strobogrammtic](https://github.com/DSC-Unilag/Algorithms/blob/master/math/generate_strobogrammtic.py)
[Is Strobogrammatic](https://github.com/DSC-Unilag/Algorithms/blob/master/math/is_strobogrammatic.py)
[Nth Digit](https://github.com/DSC-Unilag/Algorithms/blob/master/math/nth_digit.py)
[Prime Test](https://github.com/DSC-Unilag/Algorithms/blob/master/math/prime_test.py)
[Primes Sieve Of Eratosthenes](https://github.com/DSC-Unilag/Algorithms/blob/master/math/primes_sieve_of_eratosthenes.py)
[Pythagoras](https://github.com/DSC-Unilag/Algorithms/blob/master/math/pythagoras.py)
[Rabin Miller](https://github.com/DSC-Unilag/Algorithms/blob/master/math/rabin_miller.py)
[Rsa](https://github.com/DSC-Unilag/Algorithms/blob/master/math/rsa.py)
[Sqrt Precision Factor](https://github.com/DSC-Unilag/Algorithms/blob/master/math/sqrt_precision_factor.py)
| +| Matrix | [Bomb Enemy](https://github.com/DSC-Unilag/Algorithms/blob/master/matrix/bomb_enemy.py)
[Count Paths](https://github.com/DSC-Unilag/Algorithms/blob/master/matrix/count_paths.py)
[Matrix Rotation.Txt](https://github.com/DSC-Unilag/Algorithms/blob/master/matrix/matrix_rotation.txt)
[Rotate Image](https://github.com/DSC-Unilag/Algorithms/blob/master/matrix/rotate_image.py)
[Search In Sorted Matrix](https://github.com/DSC-Unilag/Algorithms/blob/master/matrix/search_in_sorted_matrix.py)
[Sparse Dot Vector](https://github.com/DSC-Unilag/Algorithms/blob/master/matrix/sparse_dot_vector.py)
[Sparse Mul](https://github.com/DSC-Unilag/Algorithms/blob/master/matrix/sparse_mul.py)
[Spiral Traversal](https://github.com/DSC-Unilag/Algorithms/blob/master/matrix/spiral_traversal.py)
| +| Queue | [ Init ](https://github.com/DSC-Unilag/Algorithms/blob/master/queue/__init__.py)
[Max Sliding Window](https://github.com/DSC-Unilag/Algorithms/blob/master/queue/max_sliding_window.py)
[Moving Average](https://github.com/DSC-Unilag/Algorithms/blob/master/queue/moving_average.py)
[Queue](https://github.com/DSC-Unilag/Algorithms/blob/master/queue/queue.py)
[Reconstruct Queue](https://github.com/DSC-Unilag/Algorithms/blob/master/queue/reconstruct_queue.py)
[Zigzagiterator](https://github.com/DSC-Unilag/Algorithms/blob/master/queue/zigzagiterator.py)
| +| Search | [Binary Search](https://github.com/DSC-Unilag/Algorithms/blob/master/search/binary_search.py)
[First Occurance](https://github.com/DSC-Unilag/Algorithms/blob/master/search/first_occurance.py)
[Last Occurance](https://github.com/DSC-Unilag/Algorithms/blob/master/search/last_occurance.py)
| +| Set | [Randomized Set](https://github.com/DSC-Unilag/Algorithms/blob/master/set/randomized_set.py)
| +| Sort | [Bubble Sort](https://github.com/DSC-Unilag/Algorithms/blob/master/sort/bubble_sort.py)
[Counting Sort](https://github.com/DSC-Unilag/Algorithms/blob/master/sort/counting_sort.py)
[Heap Sort](https://github.com/DSC-Unilag/Algorithms/blob/master/sort/heap_sort.py)
[Insertion Sort](https://github.com/DSC-Unilag/Algorithms/blob/master/sort/insertion_sort.py)
[Meeting Rooms](https://github.com/DSC-Unilag/Algorithms/blob/master/sort/meeting_rooms.py)
[Merge Sort](https://github.com/DSC-Unilag/Algorithms/blob/master/sort/merge_sort.py)
[Quick Sort](https://github.com/DSC-Unilag/Algorithms/blob/master/sort/quick_sort.py)
[Selection Sort](https://github.com/DSC-Unilag/Algorithms/blob/master/sort/selection_sort.py)
[Sort Colors](https://github.com/DSC-Unilag/Algorithms/blob/master/sort/sort_colors.py)
[Topsort](https://github.com/DSC-Unilag/Algorithms/blob/master/sort/topsort.py)
[Wiggle Sort](https://github.com/DSC-Unilag/Algorithms/blob/master/sort/wiggle_sort.py)
| +| Stack | [ Init ](https://github.com/DSC-Unilag/Algorithms/blob/master/stack/__init__.py)
[Longest Abs Path](https://github.com/DSC-Unilag/Algorithms/blob/master/stack/longest_abs_path.py)
[Simplify Path](https://github.com/DSC-Unilag/Algorithms/blob/master/stack/simplify_path.py)
[Stack](https://github.com/DSC-Unilag/Algorithms/blob/master/stack/stack.py)
[Valid Parenthesis](https://github.com/DSC-Unilag/Algorithms/blob/master/stack/valid_parenthesis.py)
| +| String | [Add Binary](https://github.com/DSC-Unilag/Algorithms/blob/master/string/add_binary.py)
[Breaking Bad](https://github.com/DSC-Unilag/Algorithms/blob/master/string/breaking_bad.py)
[Decode String](https://github.com/DSC-Unilag/Algorithms/blob/master/string/decode_string.py)
[Encode Decode](https://github.com/DSC-Unilag/Algorithms/blob/master/string/encode_decode.py)
[Group Anagrams](https://github.com/DSC-Unilag/Algorithms/blob/master/string/group_anagrams.py)
[Int To Roman](https://github.com/DSC-Unilag/Algorithms/blob/master/string/int_to_roman.py)
[Is Palindrome](https://github.com/DSC-Unilag/Algorithms/blob/master/string/is_palindrome.py)
[License Number](https://github.com/DSC-Unilag/Algorithms/blob/master/string/license_number.py)
[Make Sentence](https://github.com/DSC-Unilag/Algorithms/blob/master/string/make_sentence.py)
[Multiply Strings](https://github.com/DSC-Unilag/Algorithms/blob/master/string/multiply_strings.py)
[One Edit Distance](https://github.com/DSC-Unilag/Algorithms/blob/master/string/one_edit_distance.py)
[Rabin Karp](https://github.com/DSC-Unilag/Algorithms/blob/master/string/rabin_karp.py)
[Reverse String](https://github.com/DSC-Unilag/Algorithms/blob/master/string/reverse_string.py)
[Reverse Vowel](https://github.com/DSC-Unilag/Algorithms/blob/master/string/reverse_vowel.py)
[Reverse Words](https://github.com/DSC-Unilag/Algorithms/blob/master/string/reverse_words.py)
[Roman To Int](https://github.com/DSC-Unilag/Algorithms/blob/master/string/roman_to_int.py)
[Word Squares](https://github.com/DSC-Unilag/Algorithms/blob/master/string/word_squares.py)
| +| TMP | [Temporary.Md](https://github.com/DSC-Unilag/Algorithms/blob/master/tmp/temporary.md)
[Tree.Md](https://github.com/DSC-Unilag/Algorithms/blob/master/tree.md)
| +| Tree | [**Segment Tree Folder**](https://github.com/DSC-Unilag/Algorithms/tree/master/tree/Segment_Tree)
[Binary Tree Paths](https://github.com/DSC-Unilag/Algorithms/blob/master/tree/binary_tree_paths.py)
[Bintree2List](https://github.com/DSC-Unilag/Algorithms/blob/master/tree/bintree2list.py)
[**Bst Folder**](https://github.com/DSC-Unilag/Algorithms/tree/master/tree/bst)
[Deepest Left](https://github.com/DSC-Unilag/Algorithms/blob/master/tree/deepest_left.py)
[Invert Tree](https://github.com/DSC-Unilag/Algorithms/blob/master/tree/invert_tree.py)
[Is Balanced](https://github.com/DSC-Unilag/Algorithms/blob/master/tree/is_balanced.py)
[Is Subtree](https://github.com/DSC-Unilag/Algorithms/blob/master/tree/is_subtree.py)
[Is Symmetric](https://github.com/DSC-Unilag/Algorithms/blob/master/tree/is_symmetric.py)
[Longest Consecutive](https://github.com/DSC-Unilag/Algorithms/blob/master/tree/longest_consecutive.py)
[Lowest Common Ancestor](https://github.com/DSC-Unilag/Algorithms/blob/master/tree/lowest_common_ancestor.py)
[Max Height](https://github.com/DSC-Unilag/Algorithms/blob/master/tree/max_height.py)
[Max Path Sum](https://github.com/DSC-Unilag/Algorithms/blob/master/tree/max_path_sum.py)
[Min Height](https://github.com/DSC-Unilag/Algorithms/blob/master/tree/min_height.py)
[Path Sum](https://github.com/DSC-Unilag/Algorithms/blob/master/tree/path_sum.py)
[Path Sum2](https://github.com/DSC-Unilag/Algorithms/blob/master/tree/path_sum2.py)
[Pretty Print](https://github.com/DSC-Unilag/Algorithms/blob/master/tree/pretty_print.py)
[Same Tree](https://github.com/DSC-Unilag/Algorithms/blob/master/tree/same_tree.py)
[**Traversal Folder**](https://github.com/DSC-Unilag/Algorithms/tree/master/tree/traversal)
[Tree](https://github.com/DSC-Unilag/Algorithms/blob/master/tree/tree.py)
[**Trie**](https://github.com/DSC-Unilag/Algorithms/tree/master/tree/trie)
| +| Union Find | [Count Islands](https://github.com/DSC-Unilag/Algorithms/blob/master/union-find/count_islands.py)
\ No newline at end of file diff --git a/automate.py b/automate.py new file mode 100644 index 0000000..fa8d4ed --- /dev/null +++ b/automate.py @@ -0,0 +1,57 @@ +import requests +import json + +url = "https://api.github.com/repos/DSC-Unilag/Algorithms/contents" +response = requests.get(url) +data = json.loads(response.text) + +print("| Category | Algorithm | Sub Category |") +print("|------------------|----------------------------------------------------------------------------------------|------------------|") + +current_folder = "" +algorithm_list = "" +sub_folder = "" + +def get_sub_folder_data(sub_folder_url): + sub_folder_response = requests.get(sub_folder_url) + sub_folder_data = json.loads(sub_folder_response.text) + sub_algorithm_list = "" + for sub_file in sub_folder_data: + sub_file_name = sub_file["name"].replace(".py","") + sub_file_name = sub_file_name.replace("_", " ") + sub_file_name = sub_file_name.title() + sub_file_url = sub_file["html_url"] + sub_algorithm_list += "[" + sub_file_name + "](" + sub_file_url + ")
" + return sub_algorithm_list + +for item in data: + if item["type"] == "dir": + sub_folder_url = item["url"] + sub_folder_response = requests.get(sub_folder_url) + sub_folder_data = json.loads(sub_folder_response.text) + for sub_item in sub_folder_data: + if sub_item["type"] == "dir": + if current_folder != "": + print("| " + current_folder + " | " + algorithm_list + " | " + sub_folder + " |") + algorithm_list = "" + current_folder = item["name"] + sub_folder = sub_item["name"] + sub_folder_url = sub_item["url"] + algorithm_list = get_sub_folder_data(sub_folder_url) + else: + file_name = sub_item["name"].replace(".py","") + file_name = file_name.replace("_", " ") + file_name = file_name.title() + file_url = sub_item["html_url"] + algorithm_list += "[" + file_name + "](" + file_url + ")
" + else: + file_name = item["name"].replace(".py","") + file_name = file_name.replace("_", " ") + file_name = file_name.title() + file_url = item["html_url"] + if current_folder == "": + current_folder = "N/A" + algorithm_list += "[" + file_name + "](" + file_url + ")
" + +if current_folder != "": + print("| " + current_folder + " | " + algorithm_list + " | " + sub_folder + " |") diff --git a/queue/__pycache__/__init__.cpython-39.pyc b/queue/__pycache__/__init__.cpython-39.pyc new file mode 100644 index 0000000000000000000000000000000000000000..8235779bbb2678327b0f68c8e55560f320f46ad6 GIT binary patch literal 169 zcmYe~<>g`kf?mD-$)Z5|F^Gc(44TX@8G%BYjJFuI z{D35DVQFe<>Pm(p7N97Y_+_CVTAW%`te=sZmr`1kk(ig9s$Wo)pOu2KczG$)edCEXCP((0Nj!(T>t<8 literal 0 HcmV?d00001 diff --git a/queue/__pycache__/queue.cpython-39.pyc b/queue/__pycache__/queue.cpython-39.pyc new file mode 100644 index 0000000000000000000000000000000000000000..9e7d0ed5673d0f019ced9a3919bb02117565fb46 GIT binary patch literal 3904 zcmbVPPjlPG9o+>$5`ra#Ruo%y+XPM0PMJDV+L^|gj3*=4O&e!COd6#^wlViU_eAE}{wV$C^Tzm3Y=%sycL4l-1`OxL;Vt29l?eE`vyNuV?0)g`P z?SFRuu`0yBIhZdV2D_;FS7`nu5|PO7QJ*{e965=Lk*nl$ci+L-OKKR`l#8*4aXo2Z z+_3L!82iZz#w&JQPl7$sy3&E%h2mhei<;j;qr|>U#J-cr#Q9$AyNR24cw(QVj%O`t zBtD+?WCgNiK2A~$+@+V<7*2FZl5iAwWbr%g|>&zp3oGd853P+L;cET1-+t?=AZV5=J+ZG zXFI;JxZ`xig$?N*>l(`ChH#5)zhbK>>ZvS>HZR|5x?*7~7t5)>-D(@1M4liHe-Php zo;VX}#Kd`yP+u3f#fd!fCkTGx{@~m|YF&p)ty+8Bc;A+wkipCUqKq3sInzS;5dD^` z8xUO7waQ05Q#4dh^;KprI4g>9ACvzf)o_82Tpk8_3H+n2t}pPlVscA?N~yQukxXevmo zS@=nS!om)quy6w?EX)9kAh`l?G?G<#ZoLTZY8@Y2WW1!39h;Nru&~c`5=6%!h`sU z3e6xyoQ+O9CQMCU$vOKXi_J*eW&QXN(xA>jABMdYgE-7hY|g~abZBdOqE(yG$)1Tj zhc>cB&FWCp9_c}53Qwz8x12KLJQ_I{Ya3>I`c2d_#p;1vm329OeHM!u30xWvhMkx+ zh)5RzIdt^aMEvN!5K>I+9N*r-8qZS2ZG>}1ZA`S5r)zi=E2-$^$!@WwjQ*m|~;}jI7G>#+(7uMGHWuEfvszj{)=*FNAIyiPJ-VccwLRX-nJy z*b`ca?CRQ?sV(S#L|fd6&9(M;9TDpsGAR^^PQL}ou#Iplg8Nybo_(tIKwA^7#rkc$ zIv10ok*Jca@h-=y2j~NUvWegNqG{8G3#QSm%CwI$AV9!eq6@<|aVT!W979tu2D3H4 zaZa2QcLF0O&K+^|CPNm%4HiBRs+0}Oh~yPk%mH$g89z(S@awd%!h3`Mu&17-=J@0A zi(h4}N<{l5{SF2U@hIcGqOwt6>DVaviNv_SlBuUrnZ+{I8(cZ#C!4cB$J}kyGUT;Q zkYXUmSLZ`+lV`y#+?ln*4?jQy2f#I3a0Y1HITZSuIg7izA^vJ}H<2Ha=mQ?ZEw^ps zS)$J^6LxJ6C-Qwm1JXg6y3>^1ui+4Wcp+tZ>|%Ko-K8ExpOAs$gWHj{=U`{owOdke zVO7i5Jk0bPY_74fO#Uu=Bt%WGXkJR@+%=A+-w!nB>5_#)KkcIC z+_56`>W%|nc*Tlk>h>T}7l@jl-{a>^G&Y-XkFhxgH)ZB!dpl+-@;mO5pYFEa9*CklOiDb9}ks|HtL-wFhZ-s1lwjR?~&-Bgwg_ z)-5Esx$}#zajb(}=2__=&mOg9jDLdl`loD`+^X!7FYq$wOC%G0wRKLH%3}+$qC%BY zWD2kZIN`)GGQTvoSb z-5M>mmer@UUax4~2J{@QH_BVoFR)W-@jL9Ls}Z>Sa?CAIU+sv~ru_Y1Zz z<9OyUYlmVek7QKsQl&mHD#;DQbf*Z>QaUxC%3s5b-;O7^8@e`XKCd^q3OG*ui~expQ(8GrB3J7~ix)%GGa}*` tm-iCyH~1Afxu_2w@-JM8D0)G2;WCMZf2X|be^TAo*PG2-&06#A{{dZ&;DG=D literal 0 HcmV?d00001 From d829deb11880c42a5991a909aad14e41ef5d1b2d Mon Sep 17 00:00:00 2001 From: hendurhance Date: Sat, 14 Jan 2023 17:06:55 +0100 Subject: [PATCH 2/7] =?UTF-8?q?Rewrite=20README.md=20Documentation=20?= =?UTF-8?q?=E2=9C=8D=F0=9F=8F=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- automate.py | 57 ----------------------------------------------------- 1 file changed, 57 deletions(-) delete mode 100644 automate.py diff --git a/automate.py b/automate.py deleted file mode 100644 index fa8d4ed..0000000 --- a/automate.py +++ /dev/null @@ -1,57 +0,0 @@ -import requests -import json - -url = "https://api.github.com/repos/DSC-Unilag/Algorithms/contents" -response = requests.get(url) -data = json.loads(response.text) - -print("| Category | Algorithm | Sub Category |") -print("|------------------|----------------------------------------------------------------------------------------|------------------|") - -current_folder = "" -algorithm_list = "" -sub_folder = "" - -def get_sub_folder_data(sub_folder_url): - sub_folder_response = requests.get(sub_folder_url) - sub_folder_data = json.loads(sub_folder_response.text) - sub_algorithm_list = "" - for sub_file in sub_folder_data: - sub_file_name = sub_file["name"].replace(".py","") - sub_file_name = sub_file_name.replace("_", " ") - sub_file_name = sub_file_name.title() - sub_file_url = sub_file["html_url"] - sub_algorithm_list += "[" + sub_file_name + "](" + sub_file_url + ")
" - return sub_algorithm_list - -for item in data: - if item["type"] == "dir": - sub_folder_url = item["url"] - sub_folder_response = requests.get(sub_folder_url) - sub_folder_data = json.loads(sub_folder_response.text) - for sub_item in sub_folder_data: - if sub_item["type"] == "dir": - if current_folder != "": - print("| " + current_folder + " | " + algorithm_list + " | " + sub_folder + " |") - algorithm_list = "" - current_folder = item["name"] - sub_folder = sub_item["name"] - sub_folder_url = sub_item["url"] - algorithm_list = get_sub_folder_data(sub_folder_url) - else: - file_name = sub_item["name"].replace(".py","") - file_name = file_name.replace("_", " ") - file_name = file_name.title() - file_url = sub_item["html_url"] - algorithm_list += "[" + file_name + "](" + file_url + ")
" - else: - file_name = item["name"].replace(".py","") - file_name = file_name.replace("_", " ") - file_name = file_name.title() - file_url = item["html_url"] - if current_folder == "": - current_folder = "N/A" - algorithm_list += "[" + file_name + "](" + file_url + ")
" - -if current_folder != "": - print("| " + current_folder + " | " + algorithm_list + " | " + sub_folder + " |") From 0f0ec952044a42fa10164f2a9a093352fba9df83 Mon Sep 17 00:00:00 2001 From: hendurhance Date: Sat, 14 Jan 2023 17:11:29 +0100 Subject: [PATCH 3/7] Convery calculator.md file to python code --- design/calculator.md | 113 +++++++++++++++++++++---------------------- 1 file changed, 55 insertions(+), 58 deletions(-) diff --git a/design/calculator.md b/design/calculator.md index 463d2db..9370fb8 100644 --- a/design/calculator.md +++ b/design/calculator.md @@ -7,62 +7,59 @@ For example: ## A I think that maybe there is an error in the example above. The expression should be : (1+2)*10-24/(1-7) -> 34 Here is some implementation, convert infix notation in reverse pollish notation and calculate it -``` -boolean isDigit(char ch) { - return ch >= '0' && ch <= '9'; - } - int calc(int op2, int op1, char ch) { - switch(ch) { - case '-': return op1 - op2; - case '+': return op1 + op2; - case '/': return op1 / op2; - case '*': return op1 * op2; - } - return 0; - } - boolean higherPriority(char op1, char op2) { - if ((op1 =='*') || (op1 =='/')) - return true; - if ((op2 =='+') || (op2 =='-')) - return true; - return false; - } - int simpleCalculator(String exp) { - Stack st = new Stack<>(); - Stack op = new Stack<>(); - int digit = 0; - boolean hasDigit = false; - for (int i = 0; i < exp.length(); i++) { - if (isDigit(exp.charAt(i))) { - hasDigit = true; - digit = digit*10 + (exp.charAt(i) - '0'); - } else { - if(hasDigit) { - hasDigit = false; - st.push(digit); - digit = 0; - } - if (exp.charAt(i) == '(') { - op.push('('); - } else if(exp.charAt(i) == ')') { - while (op.peek() != '(') { - st.push(calc(st.pop(), st.pop(), op.pop())); - } - op.pop(); - } else { - while (!op.isEmpty() && op.peek() != '(' && higherPriority(op.peek(), exp.charAt(i))) { - st.push(calc(st.pop(), st.pop(), op.pop())); - } - op.push(exp.charAt(i)); - } - } - } - if(hasDigit) - st.push(digit); - while(!op.isEmpty()) { - st.push(calc(st.pop(), st.pop(), op.pop())); - } - return st.peek(); - } -} +``` python +import collections + +def is_digit(ch): + return ch >= '0' and ch <= '9' + +def calc(op2, op1, ch): + if ch == '-': + return op1 - op2 + elif ch == '+': + return op1 + op2 + elif ch == '/': + return op1 / op2 + elif ch == '*': + return op1 * op2 + else: + return 0 + +def higher_priority(op1, op2): + if op1 == '*' or op1 == '/': + return True + if op2 == '+' or op2 == '-': + return True + return False + +def simple_calculator(exp): + st = collections.deque() + op = collections.deque() + digit = 0 + has_digit = False + for i in range(len(exp)): + if is_digit(exp[i]): + has_digit = True + digit = digit * 10 + int(exp[i]) + else: + if has_digit: + has_digit = False + st.append(digit) + digit = 0 + if exp[i] == '(': + op.append('(') + elif exp[i] == ')': + while op[-1] != '(': + st.append(calc(st.pop(), st.pop(), op.pop())) + op.pop() + else: + while op and op[-1] != '(' and higher_priority(op[-1], exp[i]): + st.append(calc(st.pop(), st.pop(), op.pop())) + op.append(exp[i]) + if has_digit: + st.append(digit) + while op: + st.append(calc(st.pop(), st.pop(), op.pop())) + return st[-1] + ``` From a1a8ee8a676cb141cbd68f3a14d7aa71cd1dad05 Mon Sep 17 00:00:00 2001 From: hendurhance Date: Sat, 14 Jan 2023 17:13:26 +0100 Subject: [PATCH 4/7] =?UTF-8?q?Fix=20calculator.md=20doc=20by=20adding=20P?= =?UTF-8?q?ython=20code=20=E2=9C=85?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- design/calculator.md | 61 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 61 insertions(+) diff --git a/design/calculator.md b/design/calculator.md index 9370fb8..344a905 100644 --- a/design/calculator.md +++ b/design/calculator.md @@ -7,6 +7,66 @@ For example: ## A I think that maybe there is an error in the example above. The expression should be : (1+2)*10-24/(1-7) -> 34 Here is some implementation, convert infix notation in reverse pollish notation and calculate it +``` +boolean isDigit(char ch) { + return ch >= '0' && ch <= '9'; + } + int calc(int op2, int op1, char ch) { + switch(ch) { + case '-': return op1 - op2; + case '+': return op1 + op2; + case '/': return op1 / op2; + case '*': return op1 * op2; + } + return 0; + } + boolean higherPriority(char op1, char op2) { + if ((op1 =='*') || (op1 =='/')) + return true; + if ((op2 =='+') || (op2 =='-')) + return true; + return false; + } + int simpleCalculator(String exp) { + Stack st = new Stack<>(); + Stack op = new Stack<>(); + int digit = 0; + boolean hasDigit = false; + for (int i = 0; i < exp.length(); i++) { + if (isDigit(exp.charAt(i))) { + hasDigit = true; + digit = digit*10 + (exp.charAt(i) - '0'); + } else { + if(hasDigit) { + hasDigit = false; + st.push(digit); + digit = 0; + } + if (exp.charAt(i) == '(') { + op.push('('); + } else if(exp.charAt(i) == ')') { + while (op.peek() != '(') { + st.push(calc(st.pop(), st.pop(), op.pop())); + } + op.pop(); + } else { + while (!op.isEmpty() && op.peek() != '(' && higherPriority(op.peek(), exp.charAt(i))) { + st.push(calc(st.pop(), st.pop(), op.pop())); + } + op.push(exp.charAt(i)); + } + } + } + if(hasDigit) + st.push(digit); + while(!op.isEmpty()) { + st.push(calc(st.pop(), st.pop(), op.pop())); + } + return st.peek(); + } +} +``` +### Python ``` python import collections @@ -63,3 +123,4 @@ def simple_calculator(exp): return st[-1] ``` + From 7e8fd6077f30a9b2072f9d4ee665e55911de6485 Mon Sep 17 00:00:00 2001 From: hendurhance Date: Sat, 14 Jan 2023 17:20:18 +0100 Subject: [PATCH 5/7] =?UTF-8?q?Fix=20task=5Frunner.py,=20added=20python=20?= =?UTF-8?q?code=20to=20the=20doc=20=E2=9C=85?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- design/task_runner.md | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) diff --git a/design/task_runner.md b/design/task_runner.md index b6aa3b3..89b7476 100644 --- a/design/task_runner.md +++ b/design/task_runner.md @@ -50,3 +50,34 @@ r.push(exampleTask) // run r.push(exampleTask) // wait r.run(); ``` +### Python +``` python +import time + +def example_task(done): + time.sleep(2) + done() + +class Runner: + def __init__(self, num): + self.max_num = num + self.counter = 0 + self.queue = [] + + def push(self, callback_fn): + self.queue.append(callback_fn) + + def run(self): + if self.queue and self.counter < self.max_num: + self.counter += 1 + task = self.queue.pop(0) + done = lambda: self.counter -= 1 and self.run() and print(f'number at this moment: {self.counter}') + task(done) + +r = Runner(3) +r.push(example_task) # run +r.push(example_task) # run +r.push(example_task) # run +r.push(example_task) # wait +r.run() +``` \ No newline at end of file From 18c69cfdb2d494983081f1b5ba49a4317893833f Mon Sep 17 00:00:00 2001 From: hendurhance Date: Sat, 14 Jan 2023 17:23:53 +0100 Subject: [PATCH 6/7] =?UTF-8?q?Documentation=20for=20alarm=5Fsystem.md=20a?= =?UTF-8?q?dded=20=F0=9F=9A=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- design/alarm_system.md | 55 +++++++++++++++++++++++++++++++++++++++++- 1 file changed, 54 insertions(+), 1 deletion(-) diff --git a/design/alarm_system.md b/design/alarm_system.md index 8c3fdaa..7674e92 100644 --- a/design/alarm_system.md +++ b/design/alarm_system.md @@ -1 +1,54 @@ -Design an alarm system for a driverless car +# Design an alarm system for a driverless car + +An alarm system for a driverless car would involve several different components, including sensors to detect potential hazards, software to process sensor data and make decisions based on it, and actuators to take action in response to those decisions. Here's one possible design for such a system using Python: + +- Sensors: The car would be equipped with various sensors such as cameras, lidar, radar, and ultrasonic sensors to detect potential hazards in the car's environment, such as other vehicles, pedestrians, and obstacles. + +- Data Processing: The sensor data would be processed by software running on the car's onboard computer. This software would use algorithms such as object detection and tracking to identify and locate potential hazards, and would make decisions about how to respond based on the car's current state and the detected hazards. + +- Actuators: The car would have actuators such as brakes, steering, and accelerators to take action in response to the decisions made by the software. For example, if the car detects a potential collision with another vehicle, it would apply the brakes to slow down or stop. + +- Alarm: The car would be equipped with an alarm system that sounds an alarm in case of any emergency or if the system detects any potential hazards. The alarm system would be connected to the software running on the car's onboard computer, and would be triggered in response to the decisions made by the software. + +- Communication: The car would be equipped with communication systems such as cellular, wifi and satellite to be able to communicate with the outside world. The car would send a message to the owner or the nearest service center in case of an emergency or if the system detects any potential hazards. + +``` python +class AlarmSystem: + def __init__(self): + self.sensors = { + 'camera': CameraSensor(), + 'lidar': LidarSensor(), + 'radar': RadarSensor(), + 'ultrasonic': UltrasonicSensor() + } + self.data_processor = DataProcessor() + self.actuators = { + 'brakes': BrakeActuator(), + 'steering': SteeringActuator(), + 'accelerator': AcceleratorActuator() + } + self.alarm = Alarm() + self.communication = Communication() + + def detect_and_respond_to_hazard(self): + sensor_data = self.gather_sensor_data() + hazards = self.data_processor.detect_hazards(sensor_data) + if hazards: + self.alarm.sound() + self.communication.send_emergency_message() + self.actuators['brakes'].apply() + self.actuators['steering'].steer_away_from_hazard() + self.actuators['accelerator'].reduce_speed() + + def gather_sensor_data(self): + sensor_data = {} + for sensor_name, sensor in self.sensors.items(): + sensor_data[sensor_name] = sensor.get_data() + return sensor_data + + def stop_emergency_response(self): + self.alarm.stop() + self.actuators['brakes'].release() + self.actuators['steering'].reset() + self.actuators['accelerator'].reset() +``` From 0e730a561c739e16cae6fd03232b1f03376cdaa2 Mon Sep 17 00:00:00 2001 From: "Endurance, the Martian" Date: Sat, 14 Jan 2023 17:36:55 +0100 Subject: [PATCH 7/7] Updated Changes --- README.md | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/README.md b/README.md index 7bc4e25..3af015f 100644 --- a/README.md +++ b/README.md @@ -5,13 +5,6 @@ This project contains various common algorithms implemented in Python for learni ## Table of Content | Category | Algorithm | |------------------|----------------------------------------------------------------------------------------| -| Array | [Circular Counter](https://github.com/DSC-Unilag/Algorithms/blob/master/array/circular_counter.py)
[Flatten](https://github.com/DSC-Unilag/Algorithms/blob/master/array/flatten.py)
[Garage](https://github.com/DSC-Unilag/Algorithms/blob/master/array/garage.py)
[Longest Non Repeat](https://github.com/DSC-Unilag/Algorithms/blob/master/array/longest_non_repeat.py)
[Merge Intervals](https://github.com/DSC-Unilag/Algorithms/blob/master/array/merge_intervals.py)
[Missing Ranges](https://github.com/DSC-Unilag/Algorithms/blob/master/array/missing_ranges.py)
[Plus One](https://github.com//algorithm-in-python/tree/master/array/plus_one.py)
[Rotate Array](https://github.com/DSC-Unilag/Algorithms/blob/master/array/rotate_array.py)
[Summary Ranges](https://github.com/DSC-Unilag/Algorithms/blob/master/array/summary_ranges.py)
[Three Sum](https://github.com/DSC-Unilag/Algorithms/blob/master/array/three_sum.py)
[Two Sum](https://github.com/DSC-Unilag/Algorithms/blob/master/array/two_sum.py) | -| Backtrack | [Anagram](https://github.com/DSC-Unilag/Algorithms/blob/master/backtrack/anagram.py)
[Array Sum Combinations](https://github.com/DSC-Unilag/Algorithms/blob/master/backtrack/array_sum_combinations.py)
[Combination Sum](https://github.com/DSC-Unilag/Algorithms/blob/master/backtrack/combination_sum.py)
[Expression Add Operators](https://github.com/DSC-Unilag/Algorithms/blob/master/backtrack/expression_add_operators.py)
[Factor Combinations](https://github.com/DSC-Unilag/Algorithms/blob/master/backtrack/factor_combinations.py)
[General Solution](https://github.com/DSC-Unilag/Algorithms/blob/master/backtrack/general_solution.md)
[Generate Abbreviations](https://github.com/DSC-Unilag/Algorithms/blob/master/backtrack/generate_abbreviations.py)
[Generate Parenthesis](https://github.com//algorithm-in-python/) - - -# Test -| Category | Algorithm | -|------------------|----------------------------------------------------------------------------------------| | Array | [Circular Counter](https://github.com/DSC-Unilag/Algorithms/blob/master/array/circular_counter.py)
[Flatten](https://github.com/DSC-Unilag/Algorithms/blob/master/array/flatten.py)
[Garage](https://github.com/DSC-Unilag/Algorithms/blob/master/array/garage.py)
[Longest Non Repeat](https://github.com/DSC-Unilag/Algorithms/blob/master/array/longest_non_repeat.py)
[Merge Intervals](https://github.com/DSC-Unilag/Algorithms/blob/master/array/merge_intervals.py)
[Missing Ranges](https://github.com/DSC-Unilag/Algorithms/blob/master/array/missing_ranges.py)
[Plus One](https://github.com/DSC-Unilag/Algorithms/blob/master/array/plus_one.py)
[Rotate Array](https://github.com/DSC-Unilag/Algorithms/blob/master/array/rotate_array.py)
[Summary Ranges](https://github.com/DSC-Unilag/Algorithms/blob/master/array/summary_ranges.py)
[Three Sum](https://github.com/DSC-Unilag/Algorithms/blob/master/array/three_sum.py)
[Two Sum](https://github.com/DSC-Unilag/Algorithms/blob/master/array/two_sum.py)
| | Backtrack | [Anagram](https://github.com/DSC-Unilag/Algorithms/blob/master/backtrack/anagram.py)
[Array Sum Combinations](https://github.com/DSC-Unilag/Algorithms/blob/master/backtrack/array_sum_combinations.py)
[Combination Sum](https://github.com/DSC-Unilag/Algorithms/blob/master/backtrack/combination_sum.py)
[Expression Add Operators](https://github.com/DSC-Unilag/Algorithms/blob/master/backtrack/expression_add_operators.py)
[Factor Combinations](https://github.com/DSC-Unilag/Algorithms/blob/master/backtrack/factor_combinations.py)
[General Solution.Md](https://github.com/DSC-Unilag/Algorithms/blob/master/backtrack/general_solution.md)
[Generate Abbreviations](https://github.com/DSC-Unilag/Algorithms/blob/master/backtrack/generate_abbreviations.py)
[Generate Parenthesis](https://github.com/DSC-Unilag/Algorithms/blob/master/backtrack/generate_parenthesis.py)
[Letter Combination](https://github.com/DSC-Unilag/Algorithms/blob/master/backtrack/letter_combination.py)
[Palindrome Partitioning](https://github.com/DSC-Unilag/Algorithms/blob/master/backtrack/palindrome_partitioning.py)
[Pattern Match](https://github.com/DSC-Unilag/Algorithms/blob/master/backtrack/pattern_match.py)
[Permute](https://github.com/DSC-Unilag/Algorithms/blob/master/backtrack/permute.py)
[Permute Unique](https://github.com/DSC-Unilag/Algorithms/blob/master/backtrack/permute_unique.py)
[Subsets](https://github.com/DSC-Unilag/Algorithms/blob/master/backtrack/subsets.py)
[Subsets Unique](https://github.com/DSC-Unilag/Algorithms/blob/master/backtrack/subsets_unique.py)
[Word Search](https://github.com/DSC-Unilag/Algorithms/blob/master/backtrack/word_search.py)
| | BFS | [Shortest Distance From All Buildings](https://github.com/DSC-Unilag/Algorithms/blob/master/bfs/shortest_distance_from_all_buildings.py)
[Word Ladder](https://github.com/DSC-Unilag/Algorithms/blob/master/bfs/word_ladder.py)
| @@ -34,4 +27,4 @@ This project contains various common algorithms implemented in Python for learni | String | [Add Binary](https://github.com/DSC-Unilag/Algorithms/blob/master/string/add_binary.py)
[Breaking Bad](https://github.com/DSC-Unilag/Algorithms/blob/master/string/breaking_bad.py)
[Decode String](https://github.com/DSC-Unilag/Algorithms/blob/master/string/decode_string.py)
[Encode Decode](https://github.com/DSC-Unilag/Algorithms/blob/master/string/encode_decode.py)
[Group Anagrams](https://github.com/DSC-Unilag/Algorithms/blob/master/string/group_anagrams.py)
[Int To Roman](https://github.com/DSC-Unilag/Algorithms/blob/master/string/int_to_roman.py)
[Is Palindrome](https://github.com/DSC-Unilag/Algorithms/blob/master/string/is_palindrome.py)
[License Number](https://github.com/DSC-Unilag/Algorithms/blob/master/string/license_number.py)
[Make Sentence](https://github.com/DSC-Unilag/Algorithms/blob/master/string/make_sentence.py)
[Multiply Strings](https://github.com/DSC-Unilag/Algorithms/blob/master/string/multiply_strings.py)
[One Edit Distance](https://github.com/DSC-Unilag/Algorithms/blob/master/string/one_edit_distance.py)
[Rabin Karp](https://github.com/DSC-Unilag/Algorithms/blob/master/string/rabin_karp.py)
[Reverse String](https://github.com/DSC-Unilag/Algorithms/blob/master/string/reverse_string.py)
[Reverse Vowel](https://github.com/DSC-Unilag/Algorithms/blob/master/string/reverse_vowel.py)
[Reverse Words](https://github.com/DSC-Unilag/Algorithms/blob/master/string/reverse_words.py)
[Roman To Int](https://github.com/DSC-Unilag/Algorithms/blob/master/string/roman_to_int.py)
[Word Squares](https://github.com/DSC-Unilag/Algorithms/blob/master/string/word_squares.py)
| | TMP | [Temporary.Md](https://github.com/DSC-Unilag/Algorithms/blob/master/tmp/temporary.md)
[Tree.Md](https://github.com/DSC-Unilag/Algorithms/blob/master/tree.md)
| | Tree | [**Segment Tree Folder**](https://github.com/DSC-Unilag/Algorithms/tree/master/tree/Segment_Tree)
[Binary Tree Paths](https://github.com/DSC-Unilag/Algorithms/blob/master/tree/binary_tree_paths.py)
[Bintree2List](https://github.com/DSC-Unilag/Algorithms/blob/master/tree/bintree2list.py)
[**Bst Folder**](https://github.com/DSC-Unilag/Algorithms/tree/master/tree/bst)
[Deepest Left](https://github.com/DSC-Unilag/Algorithms/blob/master/tree/deepest_left.py)
[Invert Tree](https://github.com/DSC-Unilag/Algorithms/blob/master/tree/invert_tree.py)
[Is Balanced](https://github.com/DSC-Unilag/Algorithms/blob/master/tree/is_balanced.py)
[Is Subtree](https://github.com/DSC-Unilag/Algorithms/blob/master/tree/is_subtree.py)
[Is Symmetric](https://github.com/DSC-Unilag/Algorithms/blob/master/tree/is_symmetric.py)
[Longest Consecutive](https://github.com/DSC-Unilag/Algorithms/blob/master/tree/longest_consecutive.py)
[Lowest Common Ancestor](https://github.com/DSC-Unilag/Algorithms/blob/master/tree/lowest_common_ancestor.py)
[Max Height](https://github.com/DSC-Unilag/Algorithms/blob/master/tree/max_height.py)
[Max Path Sum](https://github.com/DSC-Unilag/Algorithms/blob/master/tree/max_path_sum.py)
[Min Height](https://github.com/DSC-Unilag/Algorithms/blob/master/tree/min_height.py)
[Path Sum](https://github.com/DSC-Unilag/Algorithms/blob/master/tree/path_sum.py)
[Path Sum2](https://github.com/DSC-Unilag/Algorithms/blob/master/tree/path_sum2.py)
[Pretty Print](https://github.com/DSC-Unilag/Algorithms/blob/master/tree/pretty_print.py)
[Same Tree](https://github.com/DSC-Unilag/Algorithms/blob/master/tree/same_tree.py)
[**Traversal Folder**](https://github.com/DSC-Unilag/Algorithms/tree/master/tree/traversal)
[Tree](https://github.com/DSC-Unilag/Algorithms/blob/master/tree/tree.py)
[**Trie**](https://github.com/DSC-Unilag/Algorithms/tree/master/tree/trie)
| -| Union Find | [Count Islands](https://github.com/DSC-Unilag/Algorithms/blob/master/union-find/count_islands.py)
\ No newline at end of file +| Union Find | [Count Islands](https://github.com/DSC-Unilag/Algorithms/blob/master/union-find/count_islands.py)