Chat with us, powered by LiveChat Earth Science-Code a doubly linked, sorted list (in ascending order) Question # 00128980 | Writedemy

Earth Science-Code a doubly linked, sorted list (in ascending order) Question # 00128980

Earth Science-Code a doubly linked, sorted list (in ascending order) Question # 00128980

Question

Code a doubly linked, sorted list (in ascending order). Each item of the list will just store an 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), accessors, 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 (i.e., 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 paremeters and returns a String representation of the list.
• Constructor (at least one), and accessors 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 a SortedList objectreference
• 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
• Delete from the sorted list the value 30, using the delete method
• 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 at 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.

Our website has a team of professional writers who can help you write any of your homework. They will write your papers from scratch. We also have a team of editors just to make sure all papers are of HIGH QUALITY & PLAGIARISM FREE. To make an Order you only need to click Ask A Question and we will direct you to our Order Page at WriteDemy. Then fill Our Order Form with all your assignment instructions. Select your deadline and pay for your paper. You will get it few hours before your set deadline.

Fill in all the assignment paper details that are required in the order form with the standard information being the page count, deadline, academic level and type of paper. It is advisable to have this information at hand so that you can quickly fill in the necessary information needed in the form for the essay writer to be immediately assigned to your writing project. Make payment for the custom essay order to enable us to assign a suitable writer to your order. Payments are made through Paypal on a secured billing page. Finally, sit back and relax.

Do you need an answer to this or any other questions?

About Writedemy

We are a professional paper writing website. If you have searched a question and bumped into our website just know you are in the right place to get help in your coursework. We offer HIGH QUALITY & PLAGIARISM FREE Papers.

How It Works

To make an Order you only need to click on “Order Now” and we will direct you to our Order Page. Fill Our Order Form with all your assignment instructions. Select your deadline and pay for your paper. You will get it few hours before your set deadline.

Are there Discounts?

All new clients are eligible for 20% off in their first Order. Our payment method is safe and secure.

Hire a tutor today CLICK HERE to make your first order