A well-organized collection of 500+ Data Structures and Algorithms problems implemented in C++. This repository serves as a comprehensive resource for anyone preparing for technical interviews, competitive programming, or looking to master fundamental CS concepts.
- 📚 20+ Topics Covered: Arrays, Graphs, Trees, Dynamic Programming, Linked Lists, and more
- 🔗 Easy Navigation: Every topic has a detailed README with categorized problem listings
- 💡 Learning-Focused: Each README includes key concepts, patterns, and practical tips
- 🎯 Interview Ready: Covers common patterns asked in FAANG and top tech companies
- ⚡ Clean Code: Well-structured C++ implementations
- 📖 Beginner Friendly: Topics explained with tips for all skill levels
practice_dsa/
├── problems/
│ └── cpp/
│ ├── arrays/ (120+ problems)
│ ├── graphs/ (60+ problems)
│ ├── trees/ (40+ problems)
│ ├── linked_list/ (45+ problems)
│ ├── dynamic_programming/ (19 problems)
│ ├── math/ (28 problems)
│ ├── binary_search/ (8 problems)
│ ├── bit_manipulation/ (8 problems)
│ ├── stack/ (11 problems)
│ ├── heaps/ (7 problems)
│ ├── strings/ (10 problems)
│ └── ... (more topics)
└── README.md
Each problem follows the structure: problems/cpp/<topic>/<problem>/
All topics are under problems/cpp/ with comprehensive README files:
- Arrays (README) - 120+ problems covering subarrays, matrices, searching, sorting, two-pointers, prefix sums, and more
- Linked Lists (README) - 45+ problems on singly/doubly linked lists, reversal, merging, cycle detection, LRU cache
- Trees (README) - 40+ problems on binary trees, BST, traversals, LCA, tree construction, binary lifting
- Graphs (README) - 60+ problems covering DFS, BFS, shortest paths, MST, topological sort, bridges, articulation points
- Stack (README) - Stack problems including balanced parentheses, monotonic stack, histogram problems
- Heaps (README) - Priority queue and heap problems
- Strings (README) - String manipulation, palindromes, pattern matching, trie applications
- Dynamic Programming (README) - 19 problems on classic DP, matrix DP, subsequences, knapsack
- Binary Search (README) - Binary search on arrays and answer space
- Bit Manipulation (README) - Bitwise operations, XOR tricks, counting bits
- Recursion (README) - Backtracking, combinations, permutations
- Sorting (README) - Sorting algorithms and applications
- Math (README) - 28 problems on GCD, primes, modular arithmetic, factorials, perfect numbers
- Hashing (README) - Hash table problems
- Matrix (README) - 2D array and matrix problems
- Queue (README) - Queue implementations
- Trie (README) - Prefix tree data structure
- OOP (README) - Object-oriented programming concepts
- Multithreading (README) - Concurrency and threading
- Miscellaneous (README) - Other interesting problems
-
Clone the repository:
git clone https://github.com/Parihar07/practice_dsa.git cd practice_dsa -
Navigate to a topic (e.g., arrays):
cd problems/cpp/arrays -
Compile and run any problem:
cd array_sorted g++ -std=c++17 *.cpp -o solution.out ./solution.out
- Language: C++11/C++17
- Compiler: g++ / clang++
- IDE: VS Code (configured with tasks.json and launch.json)
- Debugger: CodeLLDB extension for debugging
- Interview Preparation: Practice common patterns asked in coding interviews
- Competitive Programming: Build problem-solving skills
- Learning DSA: Understand core computer science concepts
- Reference: Quick lookup for algorithm implementations
Contributions are welcome! Feel free to:
- Add new problems
- Improve existing solutions
- Fix bugs or add test cases
- Enhance documentation
Please follow the existing naming convention: topic_problemname/
This repository is open source and available for educational purposes.
⭐ Star this repo if you find it helpful! ⭐
Happy Coding! 💻🚀