0
1.9kviews
What is queue? Specify ADT for it.

Mumbai University > Information Technology > Sem 3 > Data Structure and Algorithm analysis

Marks: 3 M

Year: Dec 2014

1 Answer
0
3views
  1. A queue is a linear list in which insertion and deletions take place at different ends.
  2. The end at which elements are added is called as rear end and the end at which elements are deleted is called as front.
  3. It is basically a first in first out (FIFO) linear data structure.
  4. The basic operations that can be performed on queue are
  5. Insert (or add) an element to the queue (push)
  6. Delete (or remove) an element from a queue (pop)
  7. Abstract Data Type for queue: Following is the ADT for queue:

AbstractDataType

{
    Instances
        Ordered list of items; one end is called front; the other end is called rear;
    Operations
        empty(): Return true if the queue is empty, else return false

        size(): Return the number of elements in the queue.

        front(): Return the front element of the queue.

        back(): Return the back element of the queue

        pop(): Remove an element from the front of the queue.

        push(x): Add element x at the back of the queue.
}
Please log in to add an answer.