Question: Answer ASAP!! Points: 15 Description:: In the videos for this Module, we looked at the structure and functionality of a dynamic memory queue, and the

 Answer ASAP!! Points: 15 Description:: In the videos for this Module,we looked at the structure and functionality of a dynamic memory queue,

Answer ASAP!!

Points: 15 Description:: In the videos for this Module, we looked at the structure and functionality of a dynamic memory queue, and the implementation of a queue using a dynamic circular array. In the Source Code, PowerPoints, and Video Lectures folder of this Module, you will find a OneDrive link to the project without any of the complete work. You are going to simulate the operation of a dynamic queue on paper. For the purposes of this assignment, assume that new returns the address 1024 the first time you call it and you allocate only 4 slots, and 2048 the second time (if there is a second time). Thus, if I were to declare an int (4 byte) queue and start the queue (which defaults to 16 slots initially) by doing the following operations: farmingdale::queue myQueue; myQueue. enqueue (20) myQueue. enqueue (30) myQueue.enqueue (40) myQueue.dequeue (X) The memory would look like this, with garbage values (those we don't care about) indicated with a "G" 21024 1028 21032 1036 G 30 40 G oldestindex: 1 NextInsertIndex: 3 For your assignment, assume I do the following sequence. Please draw the memory at every point you see the O. Note that the memory starts at 1024, but if the queue is reallocated, the new memory os twice the size and starts at 2048, and finally starts at 4096 if it expands a third time. Note that even if the queue shrinks to below the next size (e.g., from 8 to 4) we do not reallocate on dequeue (). Note that this is a continuous problemit does not reset at the //O. Use the algorithm we use in this module's videos, I'll check to ensure you are correct. farmingdale::stack int> yourQueue; yourQueue. enqueue (20) yourQueue. enqueue (34) yourQueue.enqueue (2) yourQueue. enqueue (85) yourQueue. dequeue (X) yourQueue.enqueue (32) yourQueue.enqueue (68) yourQueue. dequeue (X) yourQueue. enqueue (21) yourQueue. enqueue (93) yourQueue.enqueue (11) yourQueue. enqueue (87) yourQueue. enqueue (34) yourQueue.enqueue (25) yourQueue.enqueue (64) yourQueue.enqueue (23) yourQueue.enqueue (93) yourQueue.enqueue (24) yourQueue.enqueue (22) yourQueue.enqueue (53) yourQueue. enqueue (39) Points: 15 Description:: In the videos for this Module, we looked at the structure and functionality of a dynamic memory queue, and the implementation of a queue using a dynamic circular array. In the Source Code, PowerPoints, and Video Lectures folder of this Module, you will find a OneDrive link to the project without any of the complete work. You are going to simulate the operation of a dynamic queue on paper. For the purposes of this assignment, assume that new returns the address 1024 the first time you call it and you allocate only 4 slots, and 2048 the second time (if there is a second time). Thus, if I were to declare an int (4 byte) queue and start the queue (which defaults to 16 slots initially) by doing the following operations: farmingdale::queue myQueue; myQueue. enqueue (20) myQueue. enqueue (30) myQueue.enqueue (40) myQueue.dequeue (X) The memory would look like this, with garbage values (those we don't care about) indicated with a "G" 21024 1028 21032 1036 G 30 40 G oldestindex: 1 NextInsertIndex: 3 For your assignment, assume I do the following sequence. Please draw the memory at every point you see the O. Note that the memory starts at 1024, but if the queue is reallocated, the new memory os twice the size and starts at 2048, and finally starts at 4096 if it expands a third time. Note that even if the queue shrinks to below the next size (e.g., from 8 to 4) we do not reallocate on dequeue (). Note that this is a continuous problemit does not reset at the //O. Use the algorithm we use in this module's videos, I'll check to ensure you are correct. farmingdale::stack int> yourQueue; yourQueue. enqueue (20) yourQueue. enqueue (34) yourQueue.enqueue (2) yourQueue. enqueue (85) yourQueue. dequeue (X) yourQueue.enqueue (32) yourQueue.enqueue (68) yourQueue. dequeue (X) yourQueue. enqueue (21) yourQueue. enqueue (93) yourQueue.enqueue (11) yourQueue. enqueue (87) yourQueue. enqueue (34) yourQueue.enqueue (25) yourQueue.enqueue (64) yourQueue.enqueue (23) yourQueue.enqueue (93) yourQueue.enqueue (24) yourQueue.enqueue (22) yourQueue.enqueue (53) yourQueue. enqueue (39)

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!