A comprehensive collection of 1400+ algorithm implementations in Python, primarily consisting of LeetCode solutions.
python/
├── arrays/ # Array manipulation problems (880 problems)
├── backtracking/ # Backtracking algorithms (10 problems)
├── bit_manipulation/ # Bit manipulation problems (12 problems)
├── design/ # System design problems (31 problems)
├── dynamic_programming/ # Dynamic programming solutions (142 problems)
├── graphs/ # Graph algorithms (41 problems)
├── greedy/ # Greedy algorithms (9 problems)
├── hash_table/ # Hash table solutions (5 problems)
├── heap/ # Heap/Priority queue (5 problems)
├── linked_lists/ # Linked list problems (69 problems)
├── math/ # Mathematical problems (40 problems)
├── misc/ # Uncategorized problems (133 problems)
├── queue/ # Queue-based problems (7 problems)
├── recursion/ # Recursion problems (3 problems)
├── sliding_window/ # Sliding window problems (1 problem)
├── stack/ # Stack-based problems (7 problems)
├── strings/ # String manipulation (227 problems)
├── trees/ # Tree data structure problems (191 problems)
└── two_pointers/ # Two pointers technique (5 problems)
Import algorithms from specific categories:
from arrays.two_sum import Solution as TwoSum
from trees.binary_tree_inorder_traversal import Solution as InorderTraversal
from dynamic_programming.climbing_stairs import Solution as ClimbingStairs- Two/Three/Four sum
- Remove duplicates
- Search (binary search)
- Rotate array
- Merge intervals
- Product of array except self
- And many more...
- Palindrome problems
- String matching
- Encoding/decoding
- Anagrams
- And many more...
- Binary tree traversals
- BST operations
- Tree construction
- Lowest common ancestor
- And many more...
- Fibonacci
- House robber
- Coin change
- Longest subsequence
- And many more...
- BFS/DFS
- Shortest path
- Topological sort
- And many more...
- Reverse linked list
- Merge sorted lists
- Detect cycle
- And many more...
pytestMIT