This project aims to provide C# implementations for commonly used coding patterns. Each pattern includes three difficulty levels (Easy, Medium, Hard), with a Naive approach and an optimized pattern-based approach. The design supports multiple strategies via the Strategy Pattern, allowing additional approaches to be easily integrated.
A separate MSTest project ensures thorough testing, targeting 100% code coverage since these patterns do not involve UI components.
- Sliding Window
- Two Pointers
- Fast & Slow Pointers
- Merge Intervals
- Cyclic Sort
- Bitwise XOR
- Subsets
- Top 'K' Elements
- K-way Merge
- Longest Common Substring
- Tree Breadth-First Search (BFS)
- Tree Depth-First Search (DFS)
- Topological Sort (Graph)
- Trie (Prefix Tree)
- Segment Tree
- Union Find (Disjoint Set)
- Islands (Matrix Traversal)
- In-place Reversal of a Linked List
- Modified Binary Search
- Divide & Conquer
- 0/1 Knapsack (Dynamic Programming)
- Fibonacci Numbers
- Palindromic Subsequence
- Backtracking
- Monotonic Stack
- Hash Table / Hash Map
- Greedy Algorithm
This project is ongoing and is not yet complete. Contributions are welcome!
We welcome collaborators who are interested in contributing to this project! Follow these steps to get started:
- Fork the Repository: Click the "Fork" button on GitHub to create your own copy of the project.
- Clone the Repository: Clone your fork to your local machine.
git clone https://github.com/your-username/coding-patterns.git
- Create a New Branch: Name it according to the feature or bug fix.
git checkout -b feature-pattern-name
- Implement Your Changes: Add a new coding pattern implementation or improve an existing one.
- Add Unit Tests: Ensure that all implementations have MSTest cases with 100% code coverage.
- Commit and Push: Commit your changes with a meaningful message and push them to GitHub.
git add . git commit -m "Added [Pattern Name] implementation and tests" git push origin feature-pattern-name
- Create a Pull Request (PR): Go to the GitHub repository and submit a PR.
- Review & Merge: Your PR will be reviewed, and once approved, it will be merged into the main branch.
This project is licensed under the MIT License.
For questions or suggestions, feel free to open an issue or reach out via GitHub discussions!