{"id":19725215,"url":"https://github.com/momen-alshouha/data-structures-array-stack-queue","last_synced_at":"2025-07-21T23:35:33.294Z","repository":{"id":249245972,"uuid":"745621616","full_name":"Momen-Alshouha/data-structures-array-stack-queue","owner":"Momen-Alshouha","description":"This repo contains a C++ template classes for array , queue and stack , designed with OOP principles. It features various operations for those data-structues and more..","archived":false,"fork":false,"pushed_at":"2024-01-24T04:05:33.000Z","size":31,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-02-28T01:21:52.183Z","etag":null,"topics":["arrays","data-structures","object-oriented-programming","oop-principles","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-19T18:22:17.000Z","updated_at":"2024-07-19T06:52:31.000Z","dependencies_parsed_at":null,"dependency_job_id":"6b6645ea-6403-4944-a792-01d009038444","html_url":"https://github.com/Momen-Alshouha/data-structures-array-stack-queue","commit_stats":null,"previous_names":["momen-alshouha/data-structures-array-stack-queue"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/Momen-Alshouha/data-structures-array-stack-queue","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Momen-Alshouha%2Fdata-structures-array-stack-queue","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Momen-Alshouha%2Fdata-structures-array-stack-queue/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Momen-Alshouha%2Fdata-structures-array-stack-queue/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Momen-Alshouha%2Fdata-structures-array-stack-queue/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Momen-Alshouha","download_url":"https://codeload.github.com/Momen-Alshouha/data-structures-array-stack-queue/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Momen-Alshouha%2Fdata-structures-array-stack-queue/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":266403240,"owners_count":23923404,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-07-21T11:47:31.412Z","response_time":64,"last_error":null,"robots_txt_status":null,"robots_txt_updated_at":null,"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":["arrays","data-structures","object-oriented-programming","oop-principles","queue","stack"],"created_at":"2024-11-11T23:28:39.841Z","updated_at":"2025-07-21T23:35:33.269Z","avatar_url":"https://github.com/Momen-Alshouha.png","language":"C++","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Array, Stack, and Queue Implementation in C++\n\nThis repository contains C++ implementations of a dynamic array (`Array`), stack (`Stack`), and queue (`Queue`) using Object-Oriented Programming principles.\n\n## Overview\n\n### Classes\n- **Array**: Represents a dynamic array and includes functionalities for insertion, removal, resizing, and more.\n- **Stack**: Implements a basic stack using the `Array` class for storage.\n- **Queue**: Implements a basic queue using the `Array` class for storage.\n\n## Classes and Functionality\n\n### Array Class (`Array.h`)\nThe `Array` class provides the following functionalities:\n- Dynamic array implementation with insertion, removal, resizing, and other operations.\n- Features a template type to store elements of any data type.\n- Methods for accessing, inserting, and removing elements.\n- Functionality to check if the array is empty, get its size and capacity, and more.\n\n### Stack Class (`Stack.h`)\nThe `Stack` class utilizes the `Array` class for storage and implements the following stack operations:\n- Push: Adds an element to the top of the stack.\n- Pop: Removes the element from the top of the stack.\n- Top: Retrieves the top element without removing it.\n- Additional operations to get the size, check if the stack is empty, and print its elements.\n\n### Queue Class (`Queue.h`)\nThe `Queue` class also uses the `Array` class for storage and provides basic queue operations:\n- Enqueue: Adds an element to the back of the queue.\n- Dequeue: Removes the front element from the queue.\n- Front: Retrieves the front element without removing it.\n- Additional operations for checking if the queue is empty, getting its size, and printing its elements.\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: `Array.h`, `Stack.h`, and `Queue.h`.\n3. Create objects of `Array`, `Stack`, or `Queue` as needed and utilize their functionalities based on your requirements.\n\n## Example\n\n```cpp\n#include \"Array.h\"\n#include \"Stack.h\"\n#include \"Queue.h\"\n\nint main() {\n    // Example usage of the Array class with integers\n    Array\u003cint\u003e intArray;\n\n    // Insert elements\n    intArray.InsertEnd(10);\n    intArray.InsertEnd(20);\n    intArray.InsertEnd(30);\n\n    // Print array\n    cout \u003c\u003c \"Array (int): \";\n    intArray.Print();\n\n    // Access elements\n    cout \u003c\u003c \"Element at index 1: \" \u003c\u003c intArray[1] \u003c\u003c endl;\n\n    // Other operations\n    cout \u003c\u003c \"Array size: \" \u003c\u003c intArray.size \u003c\u003c endl;\n    cout \u003c\u003c \"Is array empty? \" \u003c\u003c (intArray.isEmpty() ? \"Yes\" : \"No\") \u003c\u003c endl;\n\n    // Example usage of the Stack class with strings\n    Stack\u003cstring\u003e strStack;\n\n    // Push elements\n    strStack.push(\"apple\");\n    strStack.push(\"banana\");\n    strStack.push(\"orange\");\n\n    // Print stack\n    cout \u003c\u003c \"\\nStack (string): \";\n    strStack.print();\n\n    // Pop element\n    strStack.pop();\n\n    // Peek at the top element\n    cout \u003c\u003c \"Top element: \" \u003c\u003c strStack.Top() \u003c\u003c endl;\n\n    // Example usage of the Queue class with floats\n    Queue\u003cfloat\u003e floatQueue;\n\n    // Enqueue elements\n    floatQueue.Enqueue(3.14f);\n    floatQueue.Enqueue(2.5f);\n    floatQueue.Enqueue(1.0f);\n\n    // Print queue\n    cout \u003c\u003c \"\\nQueue (float): \";\n    floatQueue.Print();\n\n    // Dequeue element\n    floatQueue.Dequeue();\n\n    // Front element\n    cout \u003c\u003c \"Front element: \" \u003c\u003c floatQueue.Front() \u003c\u003c endl;\n\n    return 0;\n}\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmomen-alshouha%2Fdata-structures-array-stack-queue","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmomen-alshouha%2Fdata-structures-array-stack-queue","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmomen-alshouha%2Fdata-structures-array-stack-queue/lists"}