cs-algorithms-and-patterns
A reference implementation of core computer science concepts in C# (.NET Framework). Covers sorting, searching, data structures, and all 23 Gang of Four design patterns — each implemented cleanly with working examples and unit tests.
Topics
Sorting Algorithms (15)
| Algorithm | Complexity (avg) |
|---|
| Bubble Sort | O(n²) |
| Selection Sort | O(n²) |
| Insertion Sort | O(n²) |
| Shell Sort | O(n log²n) |
| Quick Sort | O(n log n) |
| Merge Sort | O(n log n) |
| Heap Sort | O(n log n) |
| Tim Sort | O(n log n) |
| Tree Sort | O(n log n) |
| Cube Sort | O(n log n) |
| Bucket Sort | O(n + k) |
| Counting Sort | O(n + k) |
| Radix Sort | O(nk) |
| Bogo Sort | O(∞) |
Searching Algorithms (8)
Linear Search, Binary Search, Jump Search, Exponential Search, Fibonacci Search, Interpolation Search, Depth-First Search, Breadth-First Search
Data Structures
| Structure | Notes |
|---|
| Binary Search Tree | Insert, Search, Delete |
| AVL Tree | Self-balancing BST |
| Red-Black Tree | Self-balancing BST |
| Splay Tree | Self-adjusting BST |
| KD-Tree | k-dimensional space partitioning, nearest neighbor |
| Skip List | Probabilistic, O(log n) average ops |
| Stack | Array-backed |
| Queue | Array-backed |
| Single Linked List | |
| Double Linked List | |
Hash Table Collision Strategies (10)
Linear Probing, Open Addressing (Quadratic), Double Hashing, Separate Chaining, Cuckoo Hashing, Hopscotch Hashing, Robin Hood Hashing, Coalesced Hashing, Two-Choice Hashing, Dynamic Resizing