Skip to content

This repository provides a comprehensive collection of C++ code examples and notes for Data Structures and Algorithms (DSA), organized by lecture. It is designed for students, learners, and competitive programmers to efficiently understand and implement core DSA concepts.

Notifications You must be signed in to change notification settings

Surajgupta001/DSA-CPP

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

📘 Data Structures and Algorithms in C++

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.

🗂️ Table of Contents

📚 About This Repository

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.

📂 Lecture Directory Quick Links

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:

📝 Topics Covered

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

📖 How to Use This Repository

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++).

⚙️ Compiling and Running Code

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.

💻 Prerequisites & Recommended Tools

🤝 Contributing

Contributions are welcome! To contribute:

  1. Fork this repository
  2. Create a new branch (git checkout -b feature-name)
  3. Add your code or improvements
  4. Commit your changes (git commit -m 'Add feature')
  5. Push to your fork (git push origin feature-name)
  6. Open a Pull Request

Please ensure your code is well-documented and follows consistent formatting.

🔗 Additional Resources

📝 License

This project is licensed under the MIT License.


Happy Coding!

About

This repository provides a comprehensive collection of C++ code examples and notes for Data Structures and Algorithms (DSA), organized by lecture. It is designed for students, learners, and competitive programmers to efficiently understand and implement core DSA concepts.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages