Starting Out with C++: Early Objects (9th Edition)
Starting Out with C++: Early Objects (9th Edition)
9th Edition
ISBN: 9780134400242
Author: Tony Gaddis, Judy Walters, Godfrey Muganda
Publisher: PEARSON
Question
Book Icon
Chapter 18, Problem 15RQE
Program Plan Intro

Queue:

  • A queue contains sequence of items.
  • The item which is inserted first is retrieved first.
  • Queue performs “First In First Out”.

Operations performed on Queue:

A queue can perform two operations. They are:

  • Enqueue
  • Dequeue

Enqueue:

Insertion of an element into the queue is called as Enqueue. The elements can be inserted at any end of the queue. The sides in which the items are inserted are called as “Rear”.

Dequeue:

Retrieving an element from the queue is known as Dequeue. The sides in which the items are retrieved are called as “Front”.

Blurred answer
Students have asked these similar questions
Suppose the following operations are performed on an empty queue:enqueue(5);enqueue(?);dequeue();enqueue(9);enqueue ( 12);dequeue();enqueue(10);Insert numbers in the following diagram to show what will be stored in the staticqueue after the operations have executed .front rear
java data structure   Queue: Q4: A program performs the following operations on an empty queue Q: Q.enqueue(24) Q.enqueue(74) Q.enqueue(34) Q.first() Q.dequeue() Q.enqueue(12) Q.dequeue() Please show the queue contents at the end of these operations. Clearly show the front of the queue.
10) Show the contents of a queue after performing the following operations: ENQUEUE (10)- ENQUEUE (20); DEQUEUE; ENQUEUE (30); ENQUEUE (40); DEQUEUE.
Knowledge Booster
Background pattern image
Similar questions
SEE MORE QUESTIONS
Recommended textbooks for you
Text book image
C++ Programming: From Problem Analysis to Program...
Computer Science
ISBN:9781337102087
Author:D. S. Malik
Publisher:Cengage Learning