Ask Question, Ask an Expert

+61-413 786 465

info@mywordsolution.com

Ask Computer Engineering Expert

Code a doubly links, sorted list (in ascending order). Each item of the list will just store int. You need to code three classes: Node, SortedList, and GroupProject,

The Node class has three instance variables, all private:

*an int, representing the value stored inside the Node

*a Node (next)

*Another Node (previous)

The methods to code are : constructor (at least one), assessors, mutators.

The SortedList class is a doubly linked list, sorted in ascending order. it has two instance variables, both private:

*an int, representing the number of items in the list

*a Node, representing the head node in the list

The methods to code are:

*insert: this method takes one parameter, an int; it has a void return value.

*delete: this method takes one parameter, an int; it returns a boolean value. If we were successful in deleting the item (ie., the value of the parameter was found in the list), then we return true; if we were not successful, then we want to output a message that the value was not found, and therefore, not deleted, and return false.

*toString: this method takes no parameters and returns a String representation of the list.

*constructor (at least one), and assessors and mutators as appropriate.

All methods should keep the list sorted in ascending order.

The GroupProject class contains the main method; it should do the following:

*create SortedList object reference

*insert successively the values 25, 17, 12, 21, 78, and 47 in the sorted list

*output the contents of the sorted list using the toString method (obviously, 30 will not be found)

*output the contents of the sorted list using the toString method

*delete from the sorted list the value 21, using the delete method

*output the contents of the sorted list using the toString method

Your insert and delete methods should work properly in all possible scenarios: inserting in an empty list, inserting at the beginning of a list, inserting in the middle of a list, inserting at the end of a list, deleting from an empty list (cannot delete), deleting an item not in the list (cannot delete), deleting the first item in a list, deleting in the middle of a list, deleting the last item in a list.

Computer Engineering, Engineering

  • Category:- Computer Engineering
  • Reference No.:- M92063602
  • Price:- $40

Priced at Now at $40, Verified Solution

Have any Question?


Related Questions in Computer Engineering

Be as specific as you can for the following questions

Be as specific as you can for the following questions, explain each concept in detail and how you arrive at your solutions. This is JUST as important as your actual answers. You are provided a unit square domain where th ...

How do you calculate the number of peaks and mass when

How do you calculate the number of peaks and mass when Bromine with two isotopes and phosphate with one isotope are put through a mass spectrometer? The formula is PBr3

Using a telephone survey of 400 randomly selected

Using a telephone survey of 400 randomly selected registered voters, he solicits both their party identification and whether or not they had read the newspaper that day. The results are displayed in the following cross-t ...

Analyze the time complexity of the following ternary search

Analyze the time complexity of the following ternary search algorithm: identify two points that subdivide a sorted array into three parts. If the given number is equal to one of these two points, we are done. Otherwise, ...

Sally goes into a candy store and selects 12 pieces of

Sally goes into a candy store and selects 12 pieces of taffy. The candy store offers 75 varieties of taffy. How many ways are there for Sally to select her 12 pieces of taffy?

Consider the market for small business loans in the context

Consider the market for small business loans. In the context of this market. How adverse selection impact lenders. How does adverse selection impact borrowers? In the context of this market provide 2 things that a lender ...

Consider the following reactionccl4g 4 cl2g rarr ch4g 4

Consider the following reaction: CCl4(g) + 4 Cl2(g) → CH4(g) + 4 HCl(g) What mass of CCl4 is formed by the reaction of 2.00 g of methane with an excess of chlorine?

The american nursing association randomly selects 100 of

The American Nursing Association randomly selects 100 of its members from each state and invites them to participate in a survey about working conditions for hospital nurses in the United States. Which of the following i ...

Sql transactions exercisesperform the test for the

SQL Transactions Exercises Perform the test for the non-additive join property (lossless join) for the relation R(A 1 , A 2 , A 3 , A 4 , A 5 ), and the decompositions D a , D b , D c , D d  and set of functional depende ...

Coa assignment task -q1 a the fibonacci numbers are the

COA Assignment Task - Q1. (a) The Fibonacci numbers are the numbers in the following integer sequence, called the Fibonacci sequence, and are characterised by the fact that every number after the first two is the sum of ...

  • 4,153,160 Questions Asked
  • 13,132 Experts
  • 2,558,936 Questions Answered

Ask Experts for help!!

Looking for Assignment Help?

Start excelling in your Courses, Get help with Assignment

Write us your full requirement for evaluation and you will receive response within 20 minutes turnaround time.

Ask Now Help with Problems, Get a Best Answer

Why might a bank avoid the use of interest rate swaps even

Why might a bank avoid the use of interest rate swaps, even when the institution is exposed to significant interest rate

Describe the difference between zero coupon bonds and

Describe the difference between zero coupon bonds and coupon bonds. Under what conditions will a coupon bond sell at a p

Compute the present value of an annuity of 880 per year

Compute the present value of an annuity of $ 880 per year for 16 years, given a discount rate of 6 percent per annum. As

Compute the present value of an 1150 payment made in ten

Compute the present value of an $1,150 payment made in ten years when the discount rate is 12 percent. (Do not round int

Compute the present value of an annuity of 699 per year

Compute the present value of an annuity of $ 699 per year for 19 years, given a discount rate of 6 percent per annum. As