Question: SOLUTION REQUIRED WITH THE CONCEPT OF OBJECT ORIENTED PROGRAMMING ( OOP ) IN C++ WITHOUT ERRORS. A queue is a data-storage device. It's like a
SOLUTION REQUIRED WITH THE CONCEPT OF OBJECT ORIENTED PROGRAMMING ( OOP ) IN C++ WITHOUT ERRORS.
A queue is a data-storage device. It's like a stack, except that, instead of being last-in- first-out, it's first-in-first-out, like the line at a bank teller's window. If you put in 1, 2, 3, you get back 1, 2, 3 in that order. A stack needs only one index to an array (top in the STAKARAY program in Chapter 7). A queue, on the other hand, must keep track of two indexes to an array: one to the tail, where new items are added, and one to the head, where old items are removed. The tail follows the head through the array as items are added and removed. If either the tail or the head reaches the end of the array, it is reset to the beginning. Write a class template for a queue class. Assume that the programmer using the queue won't make any mistakes, like exceeding the capacity of the queue or trying to remove an item when the queue is empty. Define several queues of different data types and insert and remove data from them.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
