Welcome to my comprehensive repository of data structures and algorithms implemented in C++. This collection serves as both my personal learning journey and a resource for others looking to enhance their understanding of fundamental computer science concepts.
This repository contains implementations of various data structures and algorithms, with code examples, explanations, and practice problems to reinforce learning. Each implementation includes detailed comments and time/space complexity analysis.
-
Arrays and Strings
- Dynamic arrays
- String manipulation algorithms
-
Linked Lists
- Singly linked lists
- Doubly linked lists
- Circular linked lists
-
Stacks and Queues
- Array-based implementations
- Linked list-based implementations
- Priority queues
-
Trees
- Binary trees
- Binary search trees
- AVL trees
- Red-black trees
- Tries
-
Heaps
- Min heaps
- Max heaps
- Heap operations
-
Graphs
- Adjacency matrix
- Adjacency list
- Graph traversals
-
Sorting
- Bubble sort
- Selection sort
- Insertion sort
- Merge sort
- Quick sort
- Heap sort
-
Searching
- Linear search
- Binary search
- Depth-first search
- Breadth-first search
-
Dynamic Programming
- Memoization
- Tabulation
- Common DP problems
-
Greedy Algorithms
- Activity selection
- Huffman coding
- Minimum spanning trees
-
Divide and Conquer
- Binary search
- Merge sort
- Quick sort
- C++ compiler (GCC, Clang, or MSVC)
- Basic understanding of C++ syntax
Most programs can be compiled with:
g++ -std=c++17 filename.cpp -o output./outputEach implementation follows this structure:
- Concept Explanation: Brief overview of the data structure or algorithm
- Implementation: Well-commented C++ code
- Time/Space Complexity: Analysis of efficiency
- Use Cases: When to use this approach
- Practice Problems: Problems solved using the implementation
While this is primarily a personal learning repository, suggestions and improvements are welcome. Feel free to:
- Open issues for suggestions
- Submit pull requests with improved implementations
- Share additional practice problems
- Introduction to Algorithms by Cormen, Leiserson, Rivest, and Stein
- Competitive Programmer's Handbook by Antti Laaksonen
- GeeksforGeeks
- LeetCode
This repository is available under the MIT License - see the LICENSE file for details.
Happy coding and problem-solving!