What stages of computation does garbage collection

Assignment Help Computer Engineering
Reference no: EM1329845

class Node
{
int value;
Node next;
Node(int value, Node next)
{
this.value = value;
this.next = next;
}
Node(int value)
{
this.value = value;
}
}
class List {
Node start;
void inverse()
{
Node p = null;
for (Node q = start; q != null; q = q.next)
{
p = new Node(q.value,p);
}
start = p;
}

Please provide answers to the following questions based on above Java classes.

1. For a list with n Nodes, what is the maximum number of nodes that are "live" (i.e., accessible from a "root set" of variables) during the method inverse(), and when does this maximum occur?

2. Give a simple modification of the method inverse() above that minimizes the number of "live" nodes that are necessary for the method to work, so that any item that will not be used later can be immediately reclaimed as "garbage."

3. Suppose there is "heap space" for 10,000 nodes as Java objects and a list of 7,000 nodes which are stored in that heap. When method inverse() with the modification in (2) is applied to that list, at what stages of the computation does garbage collection take place?

Reference no: EM1329845

Questions Cloud

Write down java application to accomplish : Ask users for the past 5 years of federal taxes they have paid, save this data to an array, search for largest and the smallest amount of tax, and display it to screen.
Freedom of religion amendment guarantee : What are those two guarantees and how do they differ?
Discuss the firms from a strategic perspective : In a narrative format, discuss these firms from a strategic perspective.
Explain why is strong home currency mitigate : Explain why is strong home currency mitigate the growth of inflation rate locally
What stages of computation does garbage collection : For a list with n Nodes, what is the maximum number of nodes that are "live" (i.e., accessible from a "root set" of variables) during the method inverse(), and when does this atmost occur.
Change and leadership characteristics : Change and Leadership Characteristics - Describe a change Discuss the kinds of leadership characteristics you believe are necessary to successfully mange change in organization for the next decade.
What do you think the increase in productivity : What do you think the increase in productivity is likely to move the economy closer to full-employment or farther away.
The success of an organization in meeting : Why is Strategic Recruitment critical to the success of an organization in meeting its goals and mission?
Imperfect market conditions : Imperfect market conditions exist in the real-world of corporate finance.

Reviews

Write a Review

Computer Engineering Questions & Answers

  Implementation of memory management

Assignment covers the following eight topics and explore the implementation of memory management, processes and threads.

  Add items to the arraylist

Add items to the ArrayList, one at a time, based on user typed input. The user will be prompted for the String to be stored in the ArrayList and then hit enter. The user would be able to continue to add items to the ArrayList until they just hit e..

  Using the models in system design

In the System Analysis and Design: Models are used extensively in the wide variety of the technical occupations beyond the information technology.

  Creating program for furniture company

Write down a program for the furniture company. Direct the user in order to select O for oak, P for pine, or M for mahogany. Display the price of a table manufactured along with the chosen wood.

  For benefit of upper management that is non-technical

What edition of Windows 2003 server would you use for your domain controller? If you required four way clustering for Sherrill's Web server, what edition of Windows Server 2003 would you use.

  What are two long term benefits of e-scm

What are two market trends occurring in SCM (Supply Chain Management) industry.

  Between an open-source or freeware license distribution

As a business owner you are preparing to release a new software game. What factors must you consider to choose between an open-source or freeware license distribution.

  How could companies offering "free" products

The seminar uses Linux as an example of a company that understands competitive positioning. How can companies offering "free" products (e.g., Linux, Netscape) make money from these products? How can other companies compete with these fast-rising s..

  Program for dissimilar values for real numbers

Program for dissimilar values for real numbers

  Problems on relation and functional dependencies

Problems on  relation and functional dependencies

  Process used to detect and correct transmission errors

process used to detect and correct transmission errors.

  Developing the java program

Write down a program in java to input the basic salary of 15 persons. Each one of them receives 25% of basic as hra (house rent allowance), 15 % of the basic as conveyance and 10 % of the basic as an entertainment allowance.

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd