Computer Science Homework Solutions
Problem
#108255

Queues C++

2.  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?

6.  Suppose that queue is implemented as an array with the special reserved slot.  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 value of queueFront and queueRear after removing an element from the queue? Also what was the position of the removal queue element?

Solution
What is this?
By OTA - Overall OTA Rating
Purchase Cost Now
$2.19 CAD (was ~$11.97)
Included in Download
  • Plain text response
  • Attached file(s):
    • chap8%232%266_answers.doc
$2.19 Instant Download
Add to Cart
Why you can trust BrainMass.com
  • Your Information is Secure
  • Best Online Academic Help Service
  • Students find real academic Success
Related Solutions
  • Data Structures with C++ Using STL - Write a function template void n2front (queue& q, int n); that moves the nth element (counting from the front, which is element 1) of the queue to the front, leaving the order of ...
  • Queues C++ - Write the definition of the function template moveNthFront that takes as a parameter a queue and a positive integer, n. The function moves the nth element of the queue to the front. The order of the ...
  • Writing queue and stack algorithms. - Using only the algorithms in the queue and stack ADT's, write an algorithm called reverseQueue that copies the contents of a queue to another queue, and reverses the order of the data. After data is c ...
  • Data Structures with C++ Using STL - List the elements in the queue after each of the following operations: queue intQueue; intQueue.push(18); intQueue.push(2); intQueue.push(intQueue.front()); intQueue.push(intQueue.front( ...
  • Queues C++ - Write a function template, reverseStack, that takes a parameter a stack object and a queue object whose elements are of the same type. The function reverseStack uses the queue to reverse the elements ...
Browse