https://github.com/vovandreevik/stack-and-queue-data-structures
This C++ project implements stack and queue data structures
https://github.com/vovandreevik/stack-and-queue-data-structures
cpp oop oops-in-cpp queue stack
Last synced: 8 months ago
JSON representation
This C++ project implements stack and queue data structures
- Host: GitHub
- URL: https://github.com/vovandreevik/stack-and-queue-data-structures
- Owner: vovandreevik
- Created: 2023-03-10T13:19:23.000Z (almost 3 years ago)
- Default Branch: master
- Last Pushed: 2023-10-26T19:27:31.000Z (about 2 years ago)
- Last Synced: 2025-02-13T14:49:45.408Z (10 months ago)
- Topics: cpp, oop, oops-in-cpp, queue, stack
- Language: C++
- Homepage:
- Size: 20.5 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# C++ Stack and Queue Data Structures
This C++ project implements stack and queue data structures using two different classes:
- `StackArray` for stack data structure.
- `QueueArray` for queue data structure.
These classes provide essential operations such as push/pop (for stacks) and enQueue/deQueue (for queues). Additionally, the project includes custom exception classes for stack and queue operations.
## Project Structure
The project consists of the following files:
- `Stack.h` and `StackArray.h`: Stack data structure classes and headers.
- `Queue.h` and `QueueArray.h`: Queue data structure classes and headers.
- `StackOverflow.h`, `StackUnderflow.h`, `QueueOverflow.h`, and `QueueUnderflow.h`: Custom exception classes.
- `main.cpp`: A sample application that demonstrates the usage of stack and queue classes.
- `WrongStackSize.h` and `WrongQueueSize.h`: Custom exception classes for incorrect stack or queue sizes.
## Usage
The program allows you to use stack and queue data structures, demonstrating the key operations:
### Stack Operations:
- Push: Add an item to the stack.
- Pop: Remove the top element from the stack.
- Check for emptiness.
- Queue Operations:
- Enqueue: Add an item to the queue.
- Dequeue: Remove the front element from the queue.
- Check for emptiness.
- Custom Exception Classes
- StackOverflow: Thrown when a stack operation results in an overflow.
- StackUnderflow: Thrown when a stack operation results in an underflow.
- QueueOverflow: Thrown when a queue operation results in an overflow.
- QueueUnderflow: Thrown when a queue operation results in an underflow.
- WrongStackSize: Thrown for incorrect stack sizes.
- WrongQueueSize: Thrown for incorrect queue sizes.