What are queues and stacks?

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Guest

    What are queues and stacks?

    Stacks refer to a list in which all items are accessed and processed on the Last-In-First-Out (LIFO) basis. In a stack, elements are inserted (push operation) and deleted (pop operation) from the same end called top.

    Queues refer to a list in which insertion and deletion of an item is done on the First-In-First-Out (FIFO) basis. The items in a queue are inserted from the one end, called the rear end, and are deleted from the other end, called the front end of the queue.
  • Guest

    #2
    Stack is a type of data structure that work on the principle of LIFO(Last In First Out) .We can insert or delete from single end only in Stack.
    Queue is similar to stack but it work on the principle of FIFO (First In First Out). But Queue offers addition and deletion from both sides.

    Comment

    • Daljeet
      Senior Member
      • Dec 2014
      • 205

      #3
      Thanks for sharing this information.....

      Comment

      Working...
      😀
      😂
      🥰
      😘
      🤢
      😎
      😞
      😡
      👍
      👎