Assignment
Assignment
DATE : 24-11-2024
TOPIC : STACK
OBJECTIVE:A stack is a data structure that operates on the LIFO (Last In, First Out) principle,
meaning the last element added is the first to be removed. It supports two main operations:
push (to add an element) and pop (to remove an element). Stacks are commonly used in
backtracking, expression evaluation, and managing function calls in recursion.
SOURCE CODE :
Output :
Topic name : queue
Objective : A queue is a data structure that operates on the FIFO (First In, First Out) principle,
meaning the first element added is the first to be removed. It supports two main operations:
enqueue (to add an element) and dequeue (to remove an element). Queues are widely used in
scheduling, task management, and breadth-first search algorithms.
Source code :
Output :