Computer Science, asked by abhiranjankumar97611, 10 months ago

What is the underlying data structure of stack and queue?

Answers

Answered by nidhi2620
1

Answer:

Stacks are based on the LIFO principle, i.e., the element inserted at the last, is the first element to come out of the list

. Queues are based on the FIFO principle, i.e., the element inserted at the first, is the first element to come out of the list.

Answered by parnad2018kolkata
0

Answer:     Stacks and Queues

Explanation:     Stacks

A stack is defined by having a LIFO (Last In First Out) ordering principle. The first element added to a stack is the last to be removed. Equivalently, the last element added to a stack is the first to be removed. Operations that act on a stack have a unique terminology:

Push - add a new element to the stack.

Pop - remove an element from the stack.

             Queues

A queue is defined by having a FIFO (First In First Out) ordering principle. The first element added to a queue is the first to be removed and the last element to be added to a queue will be the last to be removed. The terminology for operations that act on queues is as follows:

Enqueue - add a new element to the queue.

Dequeue - remove an element from the queue.

#answerwithquality & #BAL

Similar questions