Question: Could you please help, I am having trouble with how to do these problems. The language is in C++. Part A Given the following memory
Could you please help, I am having trouble with how to do these problems. The language is in C++.
Part A
Given the following memory requirements
Integer 4 bytes
Address (pointer) 4 bytes
and a queue containing one hundred integers, compare the amount of memory used by your array representation of the queue to the amount of memory used by your singly linked list representation. Assume that the array representation allows a queue to contain a maximum of one hundred data items.
Note: integer and pointer memory requirements vary depending on the operating system and compiler. Integers and addresses range in size from 2 to 8 bytes, or larger. The values above represent a specific platform and were chosen for simplicity of calculation.
Part B
Suppose that you have ten queues of integers. Of these ten queues, four are 50% full, and the remaining six are 10% full. Compare the amount of memory used by your array representation of these queues with the amount of memory used by your singly linked list representation. Assume that the array representation allows a queue to contain a maximum of one hundred data items.
Part C
Suppose that you have a large object that requires 1000 bytes of memory. Repeat the analysis from Part A using a queue of large objects. How does the large object affect the memory efficiency of the two queues?
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
