Trusted by Students Everywhere
Why Choose Us?
0% AI Guarantee

Human-written only.

24/7 Support

Anytime, anywhere.

Plagiarism Free

100% Original.

Expert Tutors

Masters & PhDs.

100% Confidential

Your privacy matters.

On-Time Delivery

Never miss a deadline.

Suppose that queue is a queueType object and the size of the array implementing queue is 100

Computer Science Oct 07, 2020

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?

Expert Solution

please see the attached file.

 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?

Answer: queueFront is 99, queueRear is 26

Explanation.
Head of queue is at 99, tail at 25.
Items are enqueued at the tail; therefore tail will be increased by one, head is not changed.

b. What are the values of queueFront and queueRear after removing an element from queue?

Answer: queueFront is 0, queueRear is 25

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?

Answer: queueFront is 74, queueRear is 0

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?

Answer: queueFront is 75, queueRear is 99
Also what was the position of the removal queue element?: 74

Note: When is the full? When ( (rear+1) % MAX == front) (one free slot left)

Archived Solution
Unlocked Solution

You have full access to this solution. To save a copy with all formatting and attachments, use the button below.

Already a member? Sign In
Important Note: This solution is from our archive and has been purchased by others. Submitting it as-is may trigger plagiarism detection. Use it for reference only.

For ready-to-submit work, please order a fresh solution below.

Or get 100% fresh solution
Get Custom Quote
Secure Payment