Question

In: Computer Science

Assume there is a 30-byte heap. The free list for this heap has two elements on...

Assume there is a 30-byte heap. The free list for this heap has two elements on it. One entry describes the first 10-byte free segment (bytes 0-9), and one entry describes the other free segment (bytes 20-29).

Now assume we have a request for just a single byte of memory. In this case, the allocator will perform an action known as __________ to find a free chunk of memory that can satisfy the request.

splitting

coalescing

chopping

relocating

Refer to the previous question.

After the action is completed, how many elements are there on the free list?

3

4

2

1

__________ is a strategy for managing free space which results in the smallest leftover hole in memory.

Best fit

Next fit

First fit

Worst fit

__________ is a strategy for managing free space which results in the largest leftover hole in memory.

Next fit

Best fit

Worst fit

First fit

Solutions

Expert Solution

Please find the answer filled indash:

Assume there is a 30-byte heap. The free list for this heap has two elements on it. One entry describes the first 10-byte free segment (bytes 0-9), and one entry describes the other free segment (bytes 20-29).

Now assume we have a request for just a single byte of memory. In this case, the allocator will perform an action known as ____splitting______ to find a free chunk of memory that can satisfy the request.

splitting

coalescing

chopping

relocating

Refer to the previous question.

After the action is completed, how many elements are there on the free list?

3

4

2

1

Answer: There are 2 elements in the free list. One would be from 0-9 bytes and second would be from 20-29 bytes

____Best fit______ is a strategy for managing free space which results in the smallest leftover hole in memory.

Best fit

Next fit

First fit

Worst fit

___Worst fit_______ is a strategy for managing free space which results in the largest leftover hole in memory.

Next fit

Best fit

Worst fit

First fit


Related Solutions

Recall that an array could be a convenient way of storing the elements of a Heap....
Recall that an array could be a convenient way of storing the elements of a Heap. Give a Pseudocode that determines whether an array H[1..N] is indeed a Heap, i.e., it’s elements satisfy the Heap property.
In racket Assume that the elements of a list are indexed starting with 1. Write a...
In racket Assume that the elements of a list are indexed starting with 1. Write a function alts that takes a list of integers xs and returns a pair of lists, the first of which has all the odd-indexed elements (in the same relative order as in xs) and the second of which has all the even-indexed elements (in the same relative order as in xs). Output should be (alts (list 7 5 4 6 9 2 8 3)) '((7...
Assume we have two string variables: Shakespeare byte 'Brevity is the soul of wit' and
​Assembly Language   Assume we have two string variables: Shakespeare byte 'Brevity is the soul of wit' and Poet byte 'The problem is not in the stars but within ourselves'   Write a AL program that will interchange the contents of the two variables.
16. List the two elements involved in preparing for maintenance on heat exchangers. 21. List two...
16. List the two elements involved in preparing for maintenance on heat exchangers. 21. List two methods of cleaning the outside surfaces of tubes in a large shell- and-tube heat exchanger 26. Name the four types of plugs used in shell-and-tube heat exchangers to seal leaking tubes 28. Why is maintenance of a smaller heat exchanger done more easily in the shop?
Assume a byte-addressable memory has 64K bytes. Blocks are 8 bytes in length and the cache...
Assume a byte-addressable memory has 64K bytes. Blocks are 8 bytes in length and the cache consists of 4K bytes. Show the format for a main memory address assuming a 4-way set associative cache mapping scheme. Include the field names as well as their sizes.
We can build a heap by repeatedly calling the insert function to insert the elements into...
We can build a heap by repeatedly calling the insert function to insert the elements into the heap. Here is pseudocode: buildHeap(A) h = new empty heap   for each element e in A       h.insert(e)             What is the Big-O runtime of this version of buildHeap? Justify your answer.
Java Question 5: Count elements in the heap Write a function that returns the number of...
Java Question 5: Count elements in the heap Write a function that returns the number of elements in a min heap strictly less than a given number. Method signature: public static int elemNumHeap(PriorityQueue minHeap, int val) Please also include testers.
Memory was allocated initially for 5 elements, later on two more elements added to list. How...
Memory was allocated initially for 5 elements, later on two more elements added to list. How can space be managed in such case. Implement the scenario in C. IN C PROGRAMING
4. Assume corporate tax rate is 30% and no personal taxes. Debt is always risk-free. Risk-free...
4. Assume corporate tax rate is 30% and no personal taxes. Debt is always risk-free. Risk-free rate is 5%. a. Zoom Inc. pays 1 million in interest each year for the next 5 years. What is the present value of Zoom’s interest tax shield? b. Zoom Inc. will have free cash flow 10 million in the next year and its free cash flow will grow at a rate of 4% per year thereafter. Zoom has a deb tequity ratio of...
Assume a 222 byte memory: a. What are the lowest and highest addresses if memory is...
Assume a 222 byte memory: a. What are the lowest and highest addresses if memory is byte-addressable? b. What are the lowest and highest addresses if memory is word-addressable, assuming a 16-bit word? c. What are the lowest and highest addresses if memory is word-addressable, assuming a 32-bit word? Explain with Steps please
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT