For problems 1-4 below, suppose that queue is a queueArrayBased object and MAX_Q
ID: 644088 • Letter: F
Question
For problems 1-4 below, suppose that queue is a queueArrayBased object and MAX_QUEUE = 100.
1. suppose that the value of front is 50 and the value of back is 99?
a.) what are the value of front and back after adding an element to queue?
b.) what are the value of front and back after removing an element from queue?
2. suppose that the value of front is 99 and the value of back is 25?
a.) what are the value of front and back after adding an element to queue?
b.) what are the value of front and back after removing an element from queue?
3. suppose that the value of front is 25 and the value of back is 75?
a.) what are the value of front and back after adding an element to queue?
b.) what are the value of front and back after removing an element from queue?
4. suppose that the value of front is 99 and the value of back is 99?
a.) what are the value of front and back after adding an element to queue?
b.) what are the value of front and back after removing an element from queue?
Explanation / Answer
1 a)front=50 back=0
b) front=51 back=99 the position of removed element was 51
2. a) front=99 back=26
b)front=0 back=25
3 a) front =25 back=76
b) front = 26 back=75
4 a)front=99 back=0
b)front=0 back=99
Related Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.