Skip to content

SahilThorat11/Generalized_Data_Structure_Library

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Generalized Data Structure Library (GDSL)

C++ License Status

A comprehensive Generalized Data Structure Library (GDSL) implemented in C++ using templates to provide reusable, type-safe, and efficient implementations of commonly used data structures. Ideal for learning, projects, and competitive programming.


📂 Project Structure


Generalized-Data-Structure-Library
│
├── library
│   └── gdsl.cpp             # All data structures implemented here
│
├── examples
│   └── demo.cpp             # Example usage of the library
│
├── docs
│   └── project_overview.md  # Documentation and overview of data structures
│
├── README.md                # Project description and guide
├── LICENSE                  # MIT License
└── .gitignore               # Git ignore file


🔹 Features

The library includes generic implementations of:

Type Node Class Functionality Class
Singly Linear SinglyLLLnode SinglyLLL
Singly Circular SinglyCLLnode SinglyCLL
Doubly Linear DoublyLLLnode DoublyLLL
Doubly Circular DoublyCLLnode DoublyCLL
Stack Stacknode Stack
Queue Queuenode Queue

✅ Supported Operations

  • Insertion: At beginning, end, or any position
  • Deletion: From beginning, end, or any position
  • Display: Print elements in order
  • Count: Get number of elements
  • Stack & Queue: Standard push/pop/enqueue/dequeue operations

🌟 Project Highlights / Key Strengths

  • Generic Templates: Fully type-safe implementations using C++ templates.
  • Reusable & Modular: Single file (gdsl.cpp) can be included in any project.
  • Complete Coverage: Includes all common linear and circular data structures.
  • Clean Interface: Simple and consistent function naming for all structures.
  • Documentation Ready: Functions are documented, making it beginner-friendly.
  • Efficient & Lightweight: Minimal memory overhead, optimized operations.
  • Example-driven: examples/demo.cpp shows usage of all data structures.

💻 Example Usage

#include "../library/gdsl.cpp"

int main() {
    SinglyLLL<int> list;

    list.InsertFirst(10);
    list.InsertLast(20);
    list.InsertAtPos(15, 2);
    list.Display();        // Output: | 10 | -> | 15 | -> | 20 | -> NULL

    list.DeleteAtPos(2);
    list.Display();        // Output: | 10 | -> | 20 | -> NULL

    cout << "Total nodes: " << list.Count() << endl;
    return 0;
}

📖 Documentation

Detailed documentation for each data structure and its functions is available in the docs/project_overview.md.


🛠️ Getting Started

  1. Clone the repository:
git clone https://github.com/<your-username>/Generalized-Data-Structure-Library.git
  1. Compile the library and demo:
g++ examples/demo.cpp -o demo
./demo
  1. Include gdsl.cpp in your own projects to use the data structures.

📜 License

This project is licensed under the MIT License – see the LICENSE file for details.


✨ Author

Sahil Rajaram Thorat

About

A template-based reusable data structure library implemented in C++.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages