Problem 18
Suppose that queue is a queueType object and the size of the array implementing queue is \(100 .\) Also, suppose that the value of queueFront is 99 and the value of queueRear is 25 a. What are the values of queueFront and queueRear after adding an element to queue? b. What are the values of queueFront and queueRear after removing an element from queue?
Problem 21
Suppose that queue is implemented as an array with the special reserved slot, as described in this chapter. Also, suppose that the size of the array implementing queue is \(100 .\) If the value of queueFront is \(50,\) what is the position of the first queue element?
Problem 22
Suppose that queue is implemented as an array with the special reserved slot, as described in this chapter. Suppose that the size of the array implementing queue is \(100 .\) Also, suppose that the value of queueFront is 74 and the value of queueRear is 99 a. What are the values of queueFront and queueRear after adding an element to queue? b. What are the values of queueFront and queueRear after removing an element from queue? Also, what is the position of the removed queue element?
Problem 24
Write a function template, reverseQueue, that takes as a parameter a queue object and uses a stack object to reverse the elements of the queue.