In stack terminology, insertion operation is called PUSH operation, and removal operation is called POP operation:
Applications of Stack in Data Structure:
- Evaluation of Arithmetic Expressions.
- Backtracking.
- Delimiter Checking.
- Reverse a Data.
- Processing Function Calls.
Stack trace error is a generic term frequently associated with long error messages.
Basic Operations of Queue:
- Enqueue: Add an element to the end of the queue
- Dequeue: Remove an element from the front of the queue
- IsEmpty: Check if the queue is empty
- IsFull: Check if the queue is full
- Peek: Get the value of the front of the queue without removing it
Application of queue:
- Serving requests on a single shared resource, like a printer, CPU task scheduling, etc.
- In real-life scenarios, Call Center phone systems use Queues to hold people calling them in order, until a service representative is free.
- Handling of interrupts in real-time systems. The interrupts are handled in the same order as they arrive i.e First come first served
Comments
Leave a comment