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

  Writing a program that parses

The programming project involves writing a program that parses, using recursive descent, a GUI definition language defined in an input file and generates the GUI that it defines.

  Question 1when you use the mvc pattern the controller

question 1when you use the mvc pattern the controller directs the flow of control toa. the browser and the modelb. the

  Write a method called writenums

Write a method called writeNums that takes an integer n as a parameter and prints to the console the first n integers starting with 1 in sequential order, separated by commas. For example, consider the

  Define private instance variable to hold boolean value

Write a Java Enumeration "LetterGrade" that represents letter grades A through F including plus and minus grades. Define a private instance variable to hold a boolean value.

  Write a program that reads a file name from the keyboard

Write a program that reads a file name from the keyboard. The file contains integers, each on a separate line. The first line of the input file will contain the number of integers in the file. You then create a corresponding array and fill the array ..

  Application that reads the lengths of sides of a triangle

Write a java application that reads the lengths of the sides of a triangle from the user.

  Write a class named month

Write a class named Month. The class should have an int field named monthNumber that holds the number of the month.

  Project socket programming - udp objectives - learn socket

project socket programming - udp objectives - learn socket programming in java udp-nbsp cement your understanding of

  Write a program in java that reads contents of two vectors

Write a program in Java that reads contents of two vectors, and then displays the sum of these two vectors. The program should prompt the user to enter the size of the vectors first.

  Write a java program to compute salary

Write a Java program which computes the Salary for a given number of employees. The program prompts user to enter n the number of employees.

  Design a class named large integers

Design a class named largeIntegers such that an object of this class can store an integer of any number of digits.

  You have in your program an arraylist which contains

you have in your program an arraylist that contains employee salaries double type in arbitrary order. you need to

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