1.

Explain the various operations performed on queue data structure.

Answer»

A queue is a non-primitive data structure where an item is inserted at one end and removed from the other end.

The queue(), enqueue(item), dequeue(), isEmpty() and size() are the operations that can be performed on queues.

  • Queue() - create an empty queue
  • enqueue(item) - insert in element into the queue.
  • dequeue() - remove the element from the queue.
  • isEmpty() - returns true if queue is empty otherwise false.
  • size() - give the count of elements in a queue.


Discussion

No Comment Found

Related InterviewSolutions