{"id":22537887,"url":"https://github.com/khaledashrafh/sqgen","last_synced_at":"2025-07-06T23:37:10.357Z","repository":{"id":85810132,"uuid":"441564720","full_name":"KhaledAshrafH/SQGen","owner":"KhaledAshrafH","description":"This project demonstrates the use of inheritance, templates and exceptions in C++ to implement two generic data structures: stacks and queues. ","archived":false,"fork":false,"pushed_at":"2023-08-02T06:08:12.000Z","size":8,"stargazers_count":7,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2024-12-07T11:09:05.897Z","etag":null,"topics":["data-structures","excep","generic-programming","object-oriented-programming","oob","queue","stack","templates"],"latest_commit_sha":null,"homepage":"","language":"C++","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/KhaledAshrafH.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","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":"2021-12-24T22:27:39.000Z","updated_at":"2024-06-06T23:15:25.000Z","dependencies_parsed_at":"2023-03-13T06:51:33.260Z","dependency_job_id":"32722707-5d9b-4aa6-9197-27ed08595f7c","html_url":"https://github.com/KhaledAshrafH/SQGen","commit_stats":null,"previous_names":["khaledashrafh/generic-stack-and-queue-implementation","khaledashrafh/sqgen"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/KhaledAshrafH%2FSQGen","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/KhaledAshrafH%2FSQGen/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/KhaledAshrafH%2FSQGen/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/KhaledAshrafH%2FSQGen/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/KhaledAshrafH","download_url":"https://codeload.github.com/KhaledAshrafH/SQGen/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":236765696,"owners_count":19201326,"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","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":["data-structures","excep","generic-programming","object-oriented-programming","oob","queue","stack","templates"],"created_at":"2024-12-07T11:09:07.158Z","updated_at":"2025-02-02T07:27:02.901Z","avatar_url":"https://github.com/KhaledAshrafH.png","language":"C++","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Generic Stack and Queue Implementation in c++\n\n## Introduction\n\nThis project demonstrates the use of inheritance, templates and exceptions in C++ to implement two data structures: stacks and queues. Stacks are based on the LIFO (last in- first out) principle, while queues are based on the FIFO (first in- first out) principle. The project also shows how to make the stack and queue resizable, such that they can store any number of elements of any type.\n\n## Classes\n\nThe project consists of four classes and their implementation:\n\n- **Rectangle**: A class that represents a rectangle with length, width and area.\n- **MyList**: An abstract class template that stores an array of generic-typed elements with a capacity.\n- **MyStack**: A subclass of MyList that implements a stack data structure.\n- **MyQueue**: A subclass of MyList that implements a queue data structure.\n\n## Main Function\n\nThe main function interacts with the user through console input and output. It performs the following steps:\n\n- First, it asks the user whether to use stacks or queues (S/Q).\n- Second, it asks whether the user wants to store integers, strings or rectangles (1/2/3).\n- Third, it loops for adding elements to the chosen data structure until the user enters N for no more elements.\n- Fourth, it displays all the elements stored in the data structure by calling the getElem method until it is empty.\n\nThe main function also handles exceptions that might occur because of a wrong input from the user.\n\n## How to Run\n\nTo run this project, you need to have a C++ compiler installed on your system. You can use any IDE or command-line tool to compile and run the source code files.\n\nCopy\ng++ Rectangle.cpp MyList.cpp MyStack.cpp MyQueue.cpp main.cpp -o main ./main\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkhaledashrafh%2Fsqgen","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkhaledashrafh%2Fsqgen","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkhaledashrafh%2Fsqgen/lists"}