Skip to content

srielango/CodingPatterns

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

C# Coding Patterns

Overview

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.


Commonly Used Coding Patterns

1. Array & String Patterns

  • Sliding Window
  • Two Pointers
  • Fast & Slow Pointers
  • Merge Intervals
  • Cyclic Sort
  • Bitwise XOR
  • Subsets
  • Top 'K' Elements
  • K-way Merge
  • Longest Common Substring

2. Tree & Graph Patterns

  • 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)

3. Linked List Patterns

  • In-place Reversal of a Linked List

4. Search & Sort Patterns

  • Modified Binary Search
  • Divide & Conquer

5. Dynamic Programming & Recursion

  • 0/1 Knapsack (Dynamic Programming)
  • Fibonacci Numbers
  • Palindromic Subsequence
  • Backtracking

6. Stack & Queue Patterns

  • Monotonic Stack

7. Hashing & Greedy Algorithms

  • Hash Table / Hash Map
  • Greedy Algorithm

Project Status

This project is ongoing and is not yet complete. Contributions are welcome!


Contribution Guidelines

We welcome collaborators who are interested in contributing to this project! Follow these steps to get started:

  1. Fork the Repository: Click the "Fork" button on GitHub to create your own copy of the project.
  2. Clone the Repository: Clone your fork to your local machine.
    git clone https://github.com/your-username/coding-patterns.git
  3. Create a New Branch: Name it according to the feature or bug fix.
    git checkout -b feature-pattern-name
  4. Implement Your Changes: Add a new coding pattern implementation or improve an existing one.
  5. Add Unit Tests: Ensure that all implementations have MSTest cases with 100% code coverage.
  6. 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
  7. Create a Pull Request (PR): Go to the GitHub repository and submit a PR.
  8. Review & Merge: Your PR will be reviewed, and once approved, it will be merged into the main branch.

License

This project is licensed under the MIT License.


Contact

For questions or suggestions, feel free to open an issue or reach out via GitHub discussions!

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published