This repository contains C++ implementations of various Data Structures and Algorithms, organized by lecture topics. It serves as a comprehensive resource for learning and practicing DSA concepts, suitable for students, competitive programmers, and interview preparation.
This repository is a comprehensive collection of C++ code examples and lecture-wise notes for Data Structures and Algorithms (DSA). It is designed to help learners, students, and competitive programmers understand and implement core DSA concepts efficiently. Each topic is organized by lecture, making it easy to follow a structured learning path or quickly find reference implementations for specific algorithms and data structures.
Below are direct links to each lecture folder in this repository. Click a link to jump directly to the code and notes for that lecture:
- Lecture 0 (Project)
- Lecture 3 (Basics)
- Lecture 4-1 (Operator)
- Lecture 4-2 (Conditional)
- Lecture 5 (If_Else)
- Lecture 6 (Loop)
- Lecture 7 (Pattern)
- Lecture 10 (Function)
- Lecture 11 (Function)
- Lecture 11 (Revision)
- Lecture 12 (Array-1)
- Lecture 13 (vector-2)
- Lecture 14 (Array-3)
- Lecture 15 (Array-4-2pointer)
- Lecture 16 (Array-5-Prefixsum)
- Lecture 16 (Revision-upto)
- Lecture 17 (Array-2D)
- Lecture 18 (Array-2D-Vector)
- Lecture 19 (Array-2D-Problem)
- Lecture 20 (Array-2D-Problem)
- Lecture 21 (Array-2D-Problem)
- Lecture 22 (Time_space_complexity)
- Lecture 23 (Time_space_complexity)
- Lecture 24 (Pointer-1)
- Lecture 25 (Pointer-2)
- Lecture 26 (Pointer-3)
- Lecture 27 (Recursion-Basic)
- Lecture 28 (Recursion-1)
- Lecture 29 (Recursion-2-Array)
- Lecture 30 (Recursion-3-String)
- Lecture 31 (Recursion-4-Problems)
- Lecture 32 (Recursion-5-Problems)
- Lecture 33 (Recursion-6-Problems)
- Lecture 34 (Recursion-7-Problems)
- Lecture 35 (Bubble_Sort)
- Lecture 36 (Selection_sort)
- Lecture 37 (Insertion_sort)
- Lecture 38 (Problem_sorting)
- Lecture 39 (Merge_sort)
- Lecture 40 (Quick_sort)
- Lecture 41 (Advance_sort)
- Lecture 42 (Advance_sort)
- Lecture 43 (Problems_sorting)
- Lecture 44 (Binary Search)
- Lecture 45 (Binary Search Problems -1)
- Lecture 46 (Binary Search Problems-2)
- Lecture 47 (Binary Search Problems-3)
- Lecture 48 (String-One_Shot)
- Lecture 49 (OOPS)
- Lecture 50 (Linked List-1)
- Lecture 51 (Singly Linked List -2)
- Lecture 52 (Doubly Linked LIst)
- Lecture 53 (Circular Linked List)
- Lecture 54 (Stack-1)
- Lecture 55 (Stack-2)
- Lecture 56 (stack-3-interview)
- Lecture 57 (Queues)
- Lecture 58 (Deque)
- Lecture 59 (Ordered_Unordered_Sets)
- Lecture 60 (Hashing)
- Lecture 61 (Hashmap)
- Lecture 62 (Hashmap Problem)
- Lecture 63 (Special Algorithms - Prefix Sum)
- Lecture 64 (Special Algorithms - Slide Window)
- Lecture 65 (Special Algorithms - Bit Wise Operater)
- Lecture 66 (Special Algorithms - Prime Maths)
- Lecture 67 (Binary Tree - 1)
- Lecture 68 (Binary Tree - 2)
- Lecture 69 (Binary Tree - 3)
- Lecture 70 (Binary Search Tree - 1)
This repository is structured into lectures, each covering specific DSA topics. Below is an overview of the main areas:
- Basics & Fundamentals:
- Operators
- Conditional Statements (If/Else)
- Loops
- Number Systems
- Functions
- Arrays:
- 1D Arrays
- 2D Arrays (including Vectors)
- Array Problems (Two Pointers, Prefix Sum)
- Time and Space Complexity
- Pointers
- Recursion:
- Basic Recursion
- Recursion with Arrays and Strings
- Problem Solving with Recursion
- Sorting Algorithms:
- Bubble Sort
- Selection Sort
- Insertion Sort
- Merge Sort
- Quick Sort
- Advanced Sorting Problems
- Searching Algorithms:
- Binary Search
- Binary Search Problems
- Strings
- Object-Oriented Programming (OOPS)
- Linked Lists:
- Singly Linked List
- Doubly Linked List
- Circular Linked List
- Stacks
- Queues & Deques
- Sets & Hashing:
- Ordered/Unordered Sets
- Hashmaps and Problems
- Special Algorithms:
- Prefix Sum
- Sliding Window
- Bitwise Operators
- Prime Maths
- Trees:
- Binary Trees
- Binary Search Trees (BST)
- Heaps
- Greedy Algorithms
- Dynamic Programming (DP)
- Graphs:
- Graph Representations (Adjacency List/Map)
- Graph Traversal (BFS, DFS)
- Shortest Path Algorithms
- Disjoint Set Union (DSU)
- Topological Sort (Kahn's Algorithm)
- Graph Problems
- Backtracking:
- Basic Backtracking
- Tries
- DP with Bitmasking
- Segment Trees
- Difference Array Technique
- Maths for Competitive Programming
Each lecture directory (e.g., Lecture 12(Array-1)/
) contains C++ source files (.cpp
) related to the topic of that lecture. You can browse through the directories to find code examples for specific data structures or algorithms.
The code is intended for educational purposes and can be compiled and run using a C++ compiler (like g++).
To compile and run a C++ file, use the following command in your terminal (replace filename.cpp
with your file):
g++ filename.cpp -o output.exe
./output.exe
Or, if you are using Windows PowerShell:
g++ filename.cpp -o output.exe
./output.exe
You can also use the provided VS Code build tasks for easier compilation.
- C++ Compiler: g++ (MinGW for Windows), GCC, or Clang
- Editor: Visual Studio Code with the C/C++ extension
- Git: For version control and collaboration
- Basic C++ knowledge is recommended
Contributions are welcome! To contribute:
- Fork this repository
- Create a new branch (
git checkout -b feature-name
) - Add your code or improvements
- Commit your changes (
git commit -m 'Add feature'
) - Push to your fork (
git push origin feature-name
) - Open a Pull Request
Please ensure your code is well-documented and follows consistent formatting.
This project is licensed under the MIT License.
Happy Coding!