What are the fields in the node class

Assignment Help JAVA Programming
Reference no: EM131434818

Assignemnt: Decoding LinkedList

Purpose

To understand how Java implements a linked list

Directions

For this lab you will need to download LinkedList.java from Pilot. This is the source code for the LinkedList class that is part of the core of Java. Your task for this lab is to use this source code to answer the following questions about how a linked list is implemented in Java. Submit your answers to these questions as a PDF file to the dropbox on Pilot.

Question 1: The LinkedList class uses another class called Node (which is defined inside LinkedList.java). What are the fields in the Node class?

Question 2: The Node class uses generics. Why?

Question 3: The linkFirst method contains the following lines of code:
if (f == null)?last = newNode;
else?f.prev = newNode;
What is the value of the linked list+s size attribute at this point in the code if f == null is true?

Question 4: True or False: the removeLast method will take longer to execute the more items are in the linked list.

Question 5: True or False: the public void add(E e)method always adds the new item at the beginning of the linked list.

Question 6: True or False: the public void add(E e) method will take longer to execute the more items are in the linked list.

Question 7: The unlink method contains the following lines of code:
if (prev == null) { first = next;
} else {?prev.next = next; x.prev = null;
}
If the method is called with the first Node in the list as the parameter value, which of these will be executed: the if clause or the else clause?

Question 8: True or false: in general, the contains method takes longer to execute the more items there are in the linked list.

Question 9: The indexOf method always returns -1 if it is passed a null argument.

Reference no: EM131434818

Questions Cloud

Assumption of global macro economy : 1. What's your assumption of global macro economy in 2017? 2. How do you allocate your investment in different kinds of products this year? (please describe as detailed as you can, e.g. percentage of all products, durations, heding tools size(if ..
Forward price and initial value of forward contract : A stock is expected to pay a dividend of $1 per share in two months and in five months. The stock price is $50, and the risk-free rate of interest is 8% per annum with continuous compounding for all maturities. An investor has just taken a short p..
Discuss reasons for supporting and not supporting : In a paper, discuss the various plans that would be appropriate for consideration and discuss the reasons for supporting and not supporting specific plans.
Cost of storing a barrel of oil for one : The spot price of oil is $80 per barrel and the cost of storing a barrel of oil for one year is $3, payable at the end of the year. The risk-free interest rate is 5% per annum, continuously compounded. What is an upper bound for the one-year futur..
What are the fields in the node class : The LinkedList class uses another class called Node (which is defined inside LinkedList.java). What are the fields in the Node class? The Node class uses generics. Why?
How much does the investor gain : An investor shorts 100 shares when the share price is $50 and closes out the position six months later when the share price is $43. The shares pay a dividend of $3 per share during the six months. How much does the investor gain?
Stock symbol for rio tinto plc : Go to the website Yahoo! Finance and type in the letters "RIO" in the search box and select "Rio Tinto." You should now be directed to a Summary page where you will be able to view the beta for Rio Tinto. Note: RIO is the stock symbol for Rio Tint..
Describe the benefits and limitations of expert review : What is expert review? Describe the benefits and limitations of expert review. Describe the six different types of expert review methods. Summarize the guidelines expert reviewers should follow in order to write effective usability recommendations.
How are these issues likely to affect staffing : Bright Books is a book store chain established 10 years ago in northern Michigan. Bright Books has had great success in Michigan and Ohio and is beginning to expand into other states. Describe some strategic human resource issues Bright Books is like..

Reviews

Write a Review

JAVA Programming Questions & Answers

  Recursive factorial program

Write a class Array that encapsulates an array and provides bounds-checked access. Create a recursive factorial program that prompts the user for an integer N and writes out a series of equations representing the calculation of N!.

  Hunt the wumpus game

Reprot on Hunt the Wumpus Game has Source Code listing, screen captures and UML design here and also, may include Javadoc source here.

  Create a gui interface

Create GUI Interface in java programing with these function: Sort by last name and print all employees info, Sort by job title and print all employees info, Sort by weekly salary and print all employees info, search by job title and print that emp..

  Plot pois on a graph

Write a JAVA program that would get the locations of all the POIs from the file and plot them on a map.

  Write a university grading system in java

University grading system maintains number of tables to store, retrieve and manipulate student marks. Write a JAVA program that would simulate a number of cars.

  Wolves and sheep: design a game

This project is designed a game in java. you choose whether you'd like to write a wolf or a sheep agent. Then, you are assigned to either a "sheep" or a "wolf" team.

  Build a graphical user interface for displaying the image

Build a graphical user interface for displaying the image groups (= cluster) in JMJRST. Design and implement using a Swing interface.

  Determine the day of the week for new year''s day

This assignment contains a java project. Project evaluates the day of the week for New Year's Day.

  Write a java windowed application

Write a Java windowed application to do online quiz on general knowledge and the application also displays the quiz result.

  Input pairs of natural numbers

Java program to input pairs of natural numbers.

  Create classes implement java interface

Interface that contains a generic type. Create two classes that implement this interface.

  Java class, array, link list , generic class

These 14 questions covers java class, Array, link list , generic class.

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