This project is to use a linked list as the underlying data storage mechanism and implement both a stack and a queue.
Features:
-
Stack
- Methods:
- push
- pop
- peek
- is empty
- Methods:
-
Queue
- Methods
- enqueue
- dequeue
- peek
- is empty
- Methods
It raises custom error messages and tests to prove the functionality.
N/A
Resources:
- Various articles and research on stacks and queues
- Adam's demo in Class 10
- ChatGPT
O(1) - constant
Both the Stack and Queue implementations provide constant time operations for their primary methods (push, pop, enqueue, dequeue, peek, and is_empty). This efficiency is one of the key reasons why stacks and queues are widely used in various applications. The constant time complexity (O(1)) for these operations makes them highly efficient for tasks that require frequent additions and removals of elements. Source: ChatGPT
custom error invalid opperation error