{"id":19725216,"url":"https://github.com/momen-alshouha/data-structures-linkedlist-queue-stack","last_synced_at":"2026-06-11T19:31:38.630Z","repository":{"id":249245997,"uuid":"744613687","full_name":"Momen-Alshouha/data-structures-linkedList-queue-stack","owner":"Momen-Alshouha","description":"This repo contains a C++ template classes for circular doubly linked-list , queue and stack , designed with OOP principles. It features various operations for those data-structues.","archived":false,"fork":false,"pushed_at":"2024-01-19T00:33:01.000Z","size":22,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-11-21T19:03:16.367Z","etag":null,"topics":["aggregation","data-structures","linked-list","object-oriented-programming","queue","stack"],"latest_commit_sha":null,"homepage":"","language":"C++","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Momen-Alshouha.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-01-17T16:53:49.000Z","updated_at":"2024-07-19T06:52:45.000Z","dependencies_parsed_at":"2024-07-19T16:18:14.983Z","dependency_job_id":null,"html_url":"https://github.com/Momen-Alshouha/data-structures-linkedList-queue-stack","commit_stats":null,"previous_names":["momen-alshouha/data-structures-linkedlist-queue-stack"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/Momen-Alshouha/data-structures-linkedList-queue-stack","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Momen-Alshouha%2Fdata-structures-linkedList-queue-stack","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Momen-Alshouha%2Fdata-structures-linkedList-queue-stack/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Momen-Alshouha%2Fdata-structures-linkedList-queue-stack/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Momen-Alshouha%2Fdata-structures-linkedList-queue-stack/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Momen-Alshouha","download_url":"https://codeload.github.com/Momen-Alshouha/data-structures-linkedList-queue-stack/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Momen-Alshouha%2Fdata-structures-linkedList-queue-stack/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":34215253,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-06-11T02:00:06.485Z","response_time":57,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["aggregation","data-structures","linked-list","object-oriented-programming","queue","stack"],"created_at":"2024-11-11T23:28:39.848Z","updated_at":"2026-06-11T19:31:38.606Z","avatar_url":"https://github.com/Momen-Alshouha.png","language":"C++","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Circular Doubly Linked List with Queue and Stack Implementation in C++\n\nThis repository contains C++ implementations of a Circular Doubly Linked List, Queue, and Stack using Object-Oriented Programming principles.\n\n## Overview\n\n### Classes\n- **Node**: Represents individual nodes in the circular doubly linked list.\n- **Iterator**: Provides iteration capabilities over the linked list.\n- **LinkedList**: Implements the circular doubly linked list and its functionalities.\n- **Queue**: Implements a basic queue using the circular doubly linked list (utilizing aggregation).\n- **Stack**: Implements a basic stack using the circular doubly linked list (utilizing aggregation).\n\n## Classes and Functionality\n\n### Node Class\nThe `Node` class represents individual elements in the circular doubly linked list. Each node holds:\n- `_data`: Data of type `T`.\n- `_prev`: Pointer to the previous node.\n- `_next`: Pointer to the next node.\n\n### Iterator Class\nThe `Iterator` class provides functionality for iterating through the circular doubly linked list. It includes methods to:\n- Access node data.\n- Set node data.\n- Move to the next or previous node.\n- Access the current node.\n\n### LinkedList Class\nThe `LinkedList` class implements a circular doubly linked list with functionalities such as:\n- Retrieving the head and tail nodes.\n- Finding elements by index or data.\n- Inserting elements before or after specified nodes or at specific indices.\n- Deleting nodes by data or index.\n- Reversing the linked list.\n- Calculating the sum of elements (if the template type is arithmetic).\n- Getting the length of the linked list.\n\n### Queue Class\nThe `Queue` class utilizes aggregation to implement a basic queue using the circular doubly linked list. It includes methods to:\n- Enqueue an element to the back of the queue.\n- Dequeue the element from the front of the queue.\n- Peek at the front element without removing it.\n- Clear the queue.\n- Get the number of elements in the queue.\n- Check if the queue is empty.\n- Print the elements of the queue.\n\n### Stack Class\nThe `Stack` class also utilizes aggregation to implement a basic stack using the circular doubly linked list. It includes methods to:\n- Push an element onto the top of the stack.\n- Pop the element from the top of the stack.\n- Peek at the top element without removing it.\n- Clear the stack.\n- Get the number of elements in the stack.\n- Check if the stack is empty.\n- Print the elements of the stack.\n\n## Usage\n\nTo use this implementation, follow these steps:\n1. Clone the repository.\n2. Include the necessary header files in your C++ code: `LinkedList.h`, `Queue.h`, and `Stack.h` in your main cpp file.\n3. Create objects of `LinkedList`, `Queue`, or `Stack` as needed and utilize their functionalities based on your requirements.\n\n## Example\n\n```cpp\n// Example usage of the Circular Doubly Linked List, Queue, and Stack classes\n#include \"LinkedList.h\"\n#include \"Queue.h\"\n#include \"Stack.h\"\n\nint main() {\n    // Example usage with integers\n    LinkedList\u003cint\u003e intList;\n    Queue\u003cint\u003e intQueue;\n    Stack\u003cint\u003e intStack;\n\n    // Insert elements to the linked list\n    intList.InsertEnd(10);\n    intList.InsertEnd(20);\n    intList.InsertEnd(30);\n\n    // Enqueue elements to the queue\n    intQueue.enqueue(5);\n    intQueue.enqueue(15);\n    intQueue.enqueue(25);\n\n    // Push elements onto the stack\n    intStack.push(7);\n    intStack.push(14);\n    intStack.push(21);\n\n    // Print the elements of the linked list, queue, and stack\n    cout \u003c\u003c \"Linked List (int): \";\n    intList.print();\n\n    cout \u003c\u003c \"\\nQueue (int): \";\n    intQueue.print();\n\n    cout \u003c\u003c \"\\nStack (int): \";\n    intStack.print();\n\n    // Example usage with strings\n    LinkedList\u003cstring\u003e strList;\n    Queue\u003cstring\u003e strQueue;\n    Stack\u003cstring\u003e strStack;\n\n    // Insert elements to the linked list\n    strList.InsertEnd(\"apple\");\n    strList.InsertEnd(\"banana\");\n    strList.InsertEnd(\"orange\");\n\n    // Enqueue elements to the queue\n    strQueue.enqueue(\"dog\");\n    strQueue.enqueue(\"cat\");\n    strQueue.enqueue(\"bird\");\n\n    // Push elements onto the stack\n    strStack.push(\"one\");\n    strStack.push(\"two\");\n    strStack.push(\"three\");\n\n    // Print the elements of the linked list, queue, and stack\n    cout \u003c\u003c \"\\n\\nLinked List (string): \";\n    strList.print();\n\n    cout \u003c\u003c \"\\nQueue (string): \";\n    strQueue.print();\n\n    cout \u003c\u003c \"\\nStack (string): \";\n    strStack.print();\n\n    return 0;\n}\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmomen-alshouha%2Fdata-structures-linkedlist-queue-stack","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmomen-alshouha%2Fdata-structures-linkedlist-queue-stack","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmomen-alshouha%2Fdata-structures-linkedlist-queue-stack/lists"}