Implement the link list using java programming concepts

Assignment Help JAVA Programming
Reference no: EM13707310

Answer the following questions and also justify your answers with suitable examples

Question 1: Modify the class LinkedList by adding to it the following methods. The appropriate error message should be generated if an invalid condition occurs.

Part a: toString():modify the display function to overload the toString function of theObject class.

Part b: int length(): create this function to determine the number of items in the list (accessor function).

Part c: void clear(): create this function to remove all of the items from the list. After this operation is completed, the length of the list is zero.

Part d: void insertEnd(int item): create this function to insert item at the end of the list.

Part e: void replace(int location, int item): create this function to replace the item in the list at the position specified by location. The item should be replaced with item.

Part f: int get(int location): create a function that returns the element at the positionlocation.

Question 2 :-. Using the class LinkedList, write a program to store 50 random numbers.

Suppose that each of these random numbers is an integer in the interval [10, 99]. There must be no duplicate numbers in the list.

You need to implement the link list using java programming concepts.

Reference no: EM13707310

Questions Cloud

External gates to realize the function : Use a 4-to-1 multiplexer and a minimum number of external gates to realize the function - The inputs are only available uncomplemented.
Indexed addressing to reverse the elements : Use a loop with indirect or indexed addressing to reverse the elements of the integer array in place - Can you implement a program to indexed addressing to reverse the elements of an array?
Explain about the data warehouses and relational databases : Can you explain about the Data Warehouses and relational databases?
Write a c function called bspline : Write a C function called Bspline that takes as input a single double precision argument called x. The function returns a double precision value y determined as given
Implement the link list using java programming concepts : Modify the class LinkedList by adding to it the following methods. The appropriate error message should be generated if an invalid condition occurs.
Create a structure named dog with a string field : Create a Structure named dog with a string field for the Dog's name. Create a Structure named Cat with a string field for the Cat's name.
Prepare an overloaded constructor : Prepare an overloaded constructor that provides values for each field. Also provide get methods for each field. Save the file as Patient.java.
Establish shared-memory object between parent and child : the child process must output the sequence of numbers generated from the algorithm specified by the Collatz conjecture because the parent and child have their own copies of the data.
Write a program to implement a linear linked list : Write a C/C++ program to implement a singly linear Linked List

Reviews

Write a Review

JAVA Programming Questions & Answers

  Create java application to create and maintain contact list

Create a JAVA application to create and maintain a contact list - Create a database to store the contact information.

  Which drags html list items to and from a javascript array

Write a program which drags html list items to and from a javascript array.

  Computes and prints the total cost of the three items

A program is required which prompts the user to enter the individual price of three different items and computes and prints the total cost of the three items as well as the average cost. Remember to add sales tax (5% or 0.05) to the total cost.

  Common to perform loops that vary the loop control

When an application contains an array and you want to use every element of the array in some task, it is common to perform loops that vary the loop control variable from 0 to one less than the size of the array.

  Objective to learn the use of comments and basic math

objective to learn the use of comments and basic math operators.create a new folder called assign21 under

  Develop a reliable transfer protocol over udp

Develop a reliable transfer protocol over UDP. Focus on a Stop- and-Wait protocol.

  Write a program using bucket sort idea to create histograms

The input data are in an external file named election.txt. The first line is an integer N representing the number of candidates. The next N lines are the names of the canditates.

  Create a class account that represents a banking account.

Create a class Account that represents a banking account.

  Create java application which creates random phone number

Create and implement Java application which creates and prints a random phone number of the form xxx-xxx-xxxx. Include the dashes in the output.

  Print the contents of the array

Prepare a second loop that prints the contents of the array

  How are the packaged files viewed

How are several Java files packaged, Why is there a need for packaging java files and How are the packaged files viewed?

  How can you use a hash function to find duplicate files

How can you use a hash function to find duplicate files (even when the file name is changed)?

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