Skip to content

This repository contains clean and modular implementations of core Data Structures in C++, designed for learning, experimentation, and technical mastery. Each data structure is implemented from scratch to provide a deep understanding of how it works internally — covering both logic and performance analysis.

License

Notifications You must be signed in to change notification settings

udityamerit/Data-Structure-in-Cpp

Repository files navigation

📘 Data-Structure-in-C++

Language License: MIT Stars Forks Issues Repo Size Last Commit


🧭 Introduction

This repository contains clean and modular implementations of core Data Structures in C++, designed for learning, experimentation, and technical mastery.
Each data structure is implemented from scratch to provide a deep understanding of how it works internally — covering both logic and performance analysis.


🧩 Implemented Data Structures

🔹 Linear Data Structures

  • Arrays — Insertion, deletion, and traversal
  • Linked List — Singly, Doubly, and Circular Linked Lists
  • Stack — Implemented using both arrays and linked lists
  • Queue — Simple, Circular, and Priority Queue implementations

🔹 Non-Linear Data Structures

  • Trees — Binary Tree, Binary Search Tree (BST), AVL Tree
  • Graphs — Adjacency List, Adjacency Matrix, BFS & DFS Traversals
  • Hash Tables — Linear Probing and Chaining techniques

🧠 Core Concepts Covered

  • Dynamic Memory Management (new and delete)
  • Pointers and References
  • Recursive and Iterative Implementations
  • Templates for Generic Data Structures
  • Time and Space Complexity Analysis
  • Object-Oriented Programming Principles

🗂️ Folder Structure


Data-Structure-in-Cpp/
├── Basics Of CPP/
│   └── All the basic concepts
│
├── STL/
│   └── All the concepts of STL( vectors, lists, maps, functions etc...)
│
├── Arrays/
│   └── array_operations.cpp
│
├── LinkedLists/
│   ├── singly_linked_list.cpp
│   ├── doubly_linked_list.cpp
│   └── circular_linked_list.cpp
│
├── Stack/
│   ├── stack_using_array.cpp
│   └── stack_using_linkedlist.cpp
│
├── Queue/
│   ├── queue.cpp
│   ├── circular_queue.cpp
│   └── priority_queue.cpp
│
├── Trees/
│   ├── binary_tree.cpp
│   ├── bst.cpp
│   └── avl_tree.cpp
│
├── Graphs/
│   ├── graph_adjlist.cpp
│   ├── graph_adjmatrix.cpp
│   └── bfs_dfs.cpp
│
├── Hashing/
│   ├── hash_linear_probing.cpp
│   └── hash_chaining.cpp
│
└── README.md


⚙️ How to Run the Code

# Clone the repository
git clone https://github.com/udityamerit/Data-Structure-in-Cpp.git

# Move to the project directory
cd Data-Structure-in-Cpp

# Compile any C++ file (example)
g++ LinkedLists/singly_linked_list.cpp -o linkedlist

# Run the executable
./linkedlist

📊 Time and Space Complexity Overview

Data Structure Average Time Complexity Space Complexity
Array O(1) Access, O(n) Insert/Delete O(n)
Linked List O(n) O(n)
Stack / Queue O(1) O(n)
Binary Search Tree O(log n) O(n)
AVL Tree O(log n) O(n)
Heap O(log n) O(n)
Graph Traversal O(V + E) O(V + E)
Hash Table O(1) Average O(n)

💡 Future Enhancements

  • Add advanced trees (Red-Black Tree, B-Tree, Segment Tree)
  • Implement Graph Algorithms (Dijkstra, Kruskal, Floyd-Warshall)
  • Integrate Google Test framework for unit testing
  • Add visualization support for better understanding
  • Include benchmark analysis for all data structures

🌐 Useful Resources


👨‍💻 Author

Uditya Narayan Tiwari 🎓 B.Tech CSE (AI & ML) — VIT Bhopal University 💻 Core Team Member — Blockchain Club & Matrix Club 🌐 Portfolio 📘 Knowledge Base 🔗 GitHub | LinkedIn


🏁 License

This project is licensed under the MIT License — you are free to use, modify, and distribute it with proper credit.


If you find this repository helpful, don’t forget to give it a star and share it with others!

About

This repository contains clean and modular implementations of core Data Structures in C++, designed for learning, experimentation, and technical mastery. Each data structure is implemented from scratch to provide a deep understanding of how it works internally — covering both logic and performance analysis.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages