Computer Science, asked by panda2411, 1 day ago

CH-3 Stack and Queue .
[ Explain Stack data Structure in detail.]​

Answers

Answered by Tulika446
0

Basically Stack is a data structure called last-in, first-out (LIFO) in which insertion and deletion of elements are done at only end(which basically known as top of stack)

On other hand Queue is a first-in, first-out(FIFO) data structure in which the element that is inserted first, that first element has to take out first. The element in a queue are added at one end called the rear and removed from the other end called the front.

Stack has 3 operations

  1. Push(insert an element in to stack)
  2. Pop(delete the topmost element from stack)
  3. Peek(It returns the value of the topmost element of the stack without deleting it from the Stack)

Queue has basic 2 operations

  1. Enqueue or Insert
  2. Dequeue or Delete

There are 4 Type of queues but thats not required for school level still I'm providing their names

  • Circular Queue
  • Deque
  • Priority Queue
  • Multiple Queue

Attachments:
Similar questions