Question: 1 I Cyclic Queue You have a cyclic queue which can contain up to 8 items. There are variables that point to the head and

 1 I Cyclic Queue You have a cyclic queue which can

1 I Cyclic Queue You have a cyclic queue which can contain up to 8 items. There are variables that point to the head and tail of the queue and a variable that stores the size of the queue. 35. What is the value of size after 11 items are added and 6 items are removed? 6 A. head D. 2 size 36. What is the value of size after 8 items are added and 7 items are removed? AB D. 7 tail 37. What is the value of tail after 5 items are added and 7 items are removed? A. 2 In the above example the head is set to 0, tail is set to 3 and the size of the queue (number of items in it) is 3. The code to add data to the queue and remove data from the queue looks like this... D. 5 bool addrint datal 1 if (size B) { tail = 0; } size; bool remove(int data) { if (size > 0) 1 data = [headi: head++ if (head >= 8) 1 head = 0 } size return (true): return (true): } else { } else { return (false); return false; } } } } Prior to each of the following questions head, tail and size have been set to 0. 33. What is the value of head after 8 items are added and 4 items are removed? ? A. 7 D. 8 34. What is the value of size after 8 items are added and 4 items are removed? 4 A. 4 C5 D. 3 UFCF93-30-1 Page 8 of 14 Page 8 of 14 UFCF93-30-1 Page 9 of 14

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!