Skip to content

Navigation Menu

Sign in
Sign up

Repository files navigation

πŸ“š Data Structures & Algorithms

A growing collection of C++ implementations of core data structures, algorithms, and problem-solving exercises β€” written while learning and practicing DSA, preparing for interviews, and completing university coursework.


πŸ“‘ Table of Contents


πŸ“– Overview

This repository is a personal reference and practice log for Data Structures and Algorithms (DSA) in C++. Each file is a self-contained, runnable program demonstrating one concept, operation, or problem β€” from basic array manipulation up through trees and graph traversal. It's organized by topic so specific concepts are easy to find and review.


πŸ—‚ What's Inside

Topic What you'll find
Arrays Insertion, deletion, copying, linear/binary search, prime-number filtering, largest/smallest element, even/odd counting
Linked Lists Singly, doubly, and circular linked lists β€” insertion, deletion, reversal, palindrome check, class-based implementations
Stacks Custom stack implementation (array & linked-list based), reversing a stack using another stack, reversing a stack using recursion
Queues Linear queue, circular queue, double-ended queue (deque), priority queue using arrays
Trees Binary trees and Binary Search Trees (BST) β€” insertion, deletion, searching (iterative & recursive), height, diameter, balance check, identical-tree check, node counting, all four traversal orders (pre/in/post/level)
Graphs Graph representation via adjacency matrix/list, BFS traversal (2D array and vector/list/map based)
Sorting Algorithms Bubble sort (with variations), insertion sort
Time Complexity Practical demonstrations of loop-based and recursive time complexity
Heap Memory Dynamic memory allocation examples in C++
Algorithm Examples Fibonacci series, recursive factorial, powers of two
Overflows Includes integer overflow examples/solutions
University Codes (Manual) A dedicated set of BST, circular list, doubly list, and queue solutions organized to match university coursework/assignments

πŸ“ Repository Structure

Data-Structure-Algorithms/
β”œβ”€β”€ README.md
β”œβ”€β”€ .gitignore
β”‚
β”œβ”€β”€ Algorithms-Examples/ # Fibonacci, factorial, powers of two
β”œβ”€β”€ Heap-Memory/ # Dynamic memory allocation demos
β”œβ”€β”€ Time-Complexity/ # Loop & recursion complexity examples
β”œβ”€β”€ Overflows/ # Overflows problems & solutions
β”œβ”€β”€ Operations-On-Arrays/ # Array insertion/deletion/search/etc.
β”œβ”€β”€ Sorting-Algorithms-For-Array/ # Bubble sort, insertion sort
β”‚
β”œβ”€β”€ Linked-List/
β”‚ β”œβ”€β”€ Singly-Linked-List/
β”‚ β”‚ β”œβ”€β”€ Linked-List-Insertion/
β”‚ β”‚ └── Linked-List-Deletion/
β”‚ β”œβ”€β”€ Doubly-Linked-List/
β”‚ β”œβ”€β”€ Circular-Linked-List/
β”‚ └── Operations-On-Linked-List/ # Reversal, palindrome check
β”‚
β”œβ”€β”€ Stack-Problems/ # Custom stack + stack reversal problems
β”œβ”€β”€ Queue-Problems/ # Linear, circular, deque, priority queue
β”‚
β”œβ”€β”€ Trees-Problems/
β”‚ β”œβ”€β”€ Binary-Tree/
β”‚ β”œβ”€β”€ Binary-Search-Tree/
β”‚ β”‚ β”œβ”€β”€ Insertion-In-BST/
β”‚ β”‚ β”œβ”€β”€ Deleting-In-BST/
β”‚ β”‚ β”œβ”€β”€ Searching-In-BST/
β”‚ β”‚ β”œβ”€β”€ Checking-Tree-BST/
β”‚ β”‚ β”œβ”€β”€ Checking-Height-BST/
β”‚ β”‚ β”œβ”€β”€ Counting-Nodes-BST/
β”‚ β”‚ └── BST-Interview-Questions/ # Height, diameter, balance, identical trees
β”‚ β”œβ”€β”€ Tree-Pre-Order-Traversal/
β”‚ β”œβ”€β”€ Tree-In-Order-Traversal/
β”‚ β”œβ”€β”€ Tree-Post-Order-Traversal/
β”‚ └── Tree-Level-Order-Traversal/
β”‚
β”œβ”€β”€ Graphs/ # Adjacency matrix representation
β”‚ └── BFS-Traversal/ # BFS via 2D array and vector/list/map
β”‚
└── University-Codes-Manual/ # BST, circular/doubly list & queue tasks
 β”œβ”€β”€ BST/
 β”œβ”€β”€ Circular-List-Tasks/
 β”œβ”€β”€ Doubly-List-Tasks/
 β”œβ”€β”€ Queue-Problem-Set/
 └── Singly-List-Task/

🧰 Tech Stack

Component Details
Language C++ (mostly C++11/14-style code, standard STL where used)
Standard Library <iostream>, <vector>, <queue>, <stack>, <map>, etc. (varies per file)
Interface Command-line, single-file programs
Compiler Any standard C++ compiler β€” g++ (MinGW/Linux/macOS) or MSVC

Most files are platform-independent standard C++; a few interview-style university files were originally developed/tested on Windows in VS Code, but don't rely on Windows-only headers.


βœ… Prerequisites

You just need a working C++ compiler:

  • g++ (via MinGW-w64 on Windows, or pre-installed on most Linux distros/macOS with Xcode Command Line Tools), or
  • Any IDE with a bundled compiler (Visual Studio, CLion, Code::Blocks, Dev-C++, etc.)

You'll also need Git if you want to clone the repo (or just download the ZIP from GitHub instead).


πŸš€ Getting Started

1. Clone the repository

git clone https://github.com/abmdevx/Data-Structure-Algorithms.git
cd Data-Structure-Algorithms

No Git? Click Code β†’ Download ZIP on the GitHub page instead, then extract it.

2. Compile & run any file

Every .cpp file in this repo is self-contained β€” just compile the one you want to explore:

g++ Linked-List/Singly-Linked-List/Ultimate_Singly_List_Code.cpp -o output
./output # Linux/macOS
output.exe # Windows

Swap in the path to whichever file interests you β€” no project-wide build system or dependencies required.


🧭 How to Navigate This Repo

  • Looking for a specific data structure? Go straight to its top-level folder (Linked-List/, Trees-Problems/, Queue-Problems/, etc.).
  • Preparing for interviews? Check Leet-Code-Problems/ and Trees-Problems/Binary-Search-Tree/BST-Interview-Questions/ for classic interview-style problems (height, diameter, balance checks, identical trees, etc.).
  • Following a specific operation (insertion, deletion, traversal)? Many topics are further split into subfolders by operation, e.g. Linked-List/Singly-Linked-List/Linked-List-Insertion/ vs Linked-List-Deletion/.
  • New to a topic? Files prefixed Ultimate_ (e.g. Ultimate_Code_For_Stack.cpp, Ultimate_Singly_List_Code.cpp) are usually the most complete, consolidated implementation for that structure β€” a good starting point before diving into the smaller, operation-specific files.
  • Curious about university-specific solutions? University-Codes-Manual/ mirrors several of the same topics but organized to match specific coursework/assignment structure.

🀝 Contributing

If you find this repository helpful:

  • ⭐ Star it to show support.
  • 🍴 Fork it and add your own solutions or improvements.
  • πŸ“¬ Open a pull request if you'd like to contribute a new algorithm, fix a bug, or improve an existing implementation.

About

A comprehensive collection of Data Structures and Algorithms implemented in multiple languages (primarily C++), covering core concepts and problem-solving techniques.

Topics

Resources

Stars

1 star

Watchers

1 watching

Forks

Releases

Packages

Contributors

Languages

AltStyle γ«γ‚ˆγ£γ¦ε€‰ζ›γ•γ‚ŒγŸγƒšγƒΌγ‚Έ (->γ‚ͺγƒͺγ‚ΈγƒŠγƒ«) /