A curated collection of fundamental data structures, algorithms, and computational models — the "basic machines" of computing — implemented in Python with examples, tests, and visual diagrams.
- Arrays, Linked Lists, Stacks, Queues
- Hash Tables, Binary Trees, Graphs
- Union-Find (Disjoint Sets)
- Searching: Binary Search, BFS, DFS
- Sorting: Merge Sort, Quick Sort
- Graph Algorithms: Dijkstra, Bellman-Ford, Prim, Kruskal, Topological Sort
- Dynamic Programming (DP): Knapsack, Edit Distance, LIS, Held-Karp TSP
- Backtracking: N-Queens, Sudoku Solver
- Finite State Machines (FSM)
- Pushdown Automaton (PDA)
- Turing Machines
- Lambda Calculus
- Combinatory Logic (SKI Combinators)
- Memoization, Bitmasking helpers
- Benchmarking decorators and tools
SoftwareMechatronics/
│
├── algorithms/ # Core algorithms
├── data_structures/ # Basic data structures
├── computation_models/ # FSM, Turing, Lambda, etc.
├── utils/ # Helper utilities
├── examples/ # Example scripts (TSP, Dijkstra vs Bellman-Ford)
├── tests/ # Unit tests for all modules
└── docs/diagrams/ # Visual diagrams of dependencies
Clone the repository and install in editable mode:
git clone https://github.com/yourusername/SoftwareMechatronics.git
cd SoftwareMechatronics
D:/Users/james/AppData/Local/Programs/Python/Python311/python.exe -m pip install -e .python -m examples.dijkstra_vs_bellmanfrom SoftwareMechatronics.algorithms.graph.dijkstra import dijkstra
graph = {
'A': {'B': 1, 'C': 4},
'B': {'A': 1, 'C': 2, 'D': 5},
'C': {'A': 4, 'B': 2, 'D': 1},
'D': {'B': 5, 'C': 1}
}
print(dijkstra(graph, 'A'))We have added visual demos for ArrayBinaryTree and BinaryHeap.
Run all unit tests:
python -m unittest discover testsVisual dependency graphs and algorithm/data structure relationships are available in docs/diagrams/.
This project is licensed under the MIT License.

