Results 1 to 8 of 8

What are queues and stacks?

This is a discussion on What are queues and stacks? within the Programming forums, part of the Web Designing & Development category; Stacks refer to a list in which all items are accessed and processed on the Last-In-First-Out (LIFO) basis. In a ...

  1. #1
    Senior Member chinmay.sahoo's Avatar
    Join Date
    Dec 2013
    Location
    Banglore
    Posts
    266

    Thumbs up 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.

  2. #2
    Junior Member
    Join Date
    Apr 2017
    Posts
    10

    Default Re: What are queues and stacks?

    Unfortunately, I can not help you! I'm not good at this. Sorry!((

  3. #3
    Member
    Join Date
    Feb 2017
    Posts
    97

    Default Re: What are queues and stacks?

    These concepts are so popular in programming, I really excited when learning about them in university 6 years ago!

  4. #4
    Senior Member
    Join Date
    Feb 2016
    Posts
    159

    Default Re: What are queues and stacks?

    A stack is a collection that is based on the last-in-first-out (LIFO) policy, where as A queue supports the insert and remove operations using a first-in first-out (FIFO) discipline.

  5. #5
    Senior Member charlottegracie's Avatar
    Join Date
    Jan 2017
    Posts
    207

    Default Re: What are queues and stacks?

    In the queue only two operations are allowed enqueue and dequeue. Enqueue means to insert an item into the back of the queue, dequeue means removing the front item. The picture demonstrates the FIFO access. The difference between stacks and queues is in removing.

  6. #6
    Senior Member
    Join Date
    Nov 2016
    Posts
    152

    Default Re: What are queues and stacks?

    Agreed.Well said.

    Quote Originally Posted by charlottegracie View Post
    In the queue only two operations are allowed enqueue and dequeue. Enqueue means to insert an item into the back of the queue, dequeue means removing the front item. The picture demonstrates the FIFO access. The difference between stacks and queues is in removing.

  7. #7
    Member
    Join Date
    Mar 2018
    Location
    Santa Clara, California, USA
    Posts
    40

    Default Re: What are queues and stacks?

    A stack is a conceptual structure consisting of a set of homogeneous elements and is based on the principle of last in first out (LIFO). It is a commonly used abstract data type with two major operations, namely, push and pop. Push and pop are carried out on the topmost element, which is the item most recently added to the stack. The push operation adds an element to the stack while the pop operation removes an element from the top position. The stack concept is used in programming and memory organization in computers.

    Whereas

    In computer networking, a queue is a collection of data packets collectively waiting to be transmitted by a network device using a pre-defined structure methodology.

  8. #8
    Member
    Join Date
    Mar 2018
    Posts
    67

    Default Re: What are queues and stacks?

    Quote Originally Posted by burtonadams View Post
    A stack is a conceptual structure consisting of a set of homogeneous elements and is based on the principle of last in first out (LIFO). It is a commonly used abstract data type with two major operations, namely, push and pop. Push and pop are carried out on the topmost element, which is the item most recently added to the stack. The push operation adds an element to the stack while the pop operation removes an element from the top position. The stack concept is used in programming and memory organization in computers.

    Whereas

    In computer networking, a queue is a collection of data packets collectively waiting to be transmitted by a network device using a pre-defined structure methodology.
    Thanks for your detailed information