This repository is a comprehensive collection of Data Structures and Algorithms implementations in C++, along with a variety of practice problems and solutions. It's designed to be a valuable resource for both learning and practicing essential concepts in computer science.
All the codes are written from tutorials , self learnings and problem solving by me in the past 2 years.
Contents
- Arrays
- Implementation
- Typical problems (e.g., reversing, sorting, searching)
- C++ Reference: https://en.cppreference.com/w/cpp/container/array
- BST (Binary Search Tree)
- Implementation
- Typical problems (e.g., insertion, deletion, finding minimum/maximum)
- C++ Reference: https://en.cppreference.com/w/cpp/container/set (for std::set)
- Binary Search
- Implementation
- Typical problems (e.g., finding a target value in a sorted array)
- Binary Tree
- Implementation
- Typical problems (e.g., traversals, finding height, building from inorder/preorder/postorder)
- Bit Manipulation
- Implementation of common bit operations
- Typical problems (e.g., checking parity, setting/clearing bits)
- C++ Reference: https://en.cppreference.com/w/cpp/language/bit_field
- Deque
- Implementation
- Typical problems (e.g., inserting/deleting from both ends)
- C++ Reference: https://en.cppreference.com/w/cpp/container/deque
- Disjoint Set
- Implementation
- Typical problems (e.g., finding connected components, Kruskal's algorithm)
- Dynamic Programming
- Explanation of the concept
- Examples of DP problems and their solutions
- Generic Programming in C++
- Explanation of templates and their usage
- Examples of generic data structures and algorithms
- Graphs
- Implementation of graph representations (adjacency list, matrix)
- Typical graph algorithms (e.g., DFS, BFS, shortest path, topological sorting)
- Greedy
- Explanation of the greedy approach
- Examples of greedy algorithms (e.g., activity selection, knapsack)
- Hashing/Hashmap
- Implementation of hash tables
- Collision resolution techniques
- C++ Reference: https://en.cppreference.com/w/cpp/container/unordered_map
- Heap
- Implementation of min-heap and max-heap
- Typical problems (e.g., heap sort, priority queue)
- Linked List
- Implementation of singly and doubly linked lists
- Typical problems (e.g., insertion, deletion, reversing)
- Number Theory
- Basic number theory concepts (e.g., prime numbers, modular arithmetic)
- Typical problems (e.g., primality testing, finding GCD)
- OA (Object-Oriented Analysis?)
- (Provide a brief description of the content here)
- OOPS (Object-Oriented Programming?)
- (Provide a brief description of the content here)
- Other Problems and Algos
- Solutions to various problems not covered in specific categories
- Practice
- A collection of practice problems with solutions
- Queue
- Implementation
- Typical problems (e.g., enqueue, dequeue)
- C++ Reference: https://en.cppreference.com/w/cpp/container/queue
- Recursion
- Explanation of recursion
- Examples of recursive algorithms (e.g., factorial, Fibonacci)
- Set
- Implementation
- Typical problems (e.g., finding unions, intersections)
- C++ Reference: https://en.cppreference.com/w/cpp/container/set
- Sorting
- Implementation of various sorting algorithms (e.g., bubble sort, merge sort, quick sort)
- Stack
- Implementation
- Typical problems (e.g., balanced parentheses, postfix evaluation)
- C++ Reference: https://en.cppreference.com/w/cpp/container/stack
- String
- String manipulation algorithms (e.g., reversing, palindrome