Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Can someone please help me? in Java, please. You will need two classes: 1. Linkedlist class, which will represent the full list. 2. Node class.

Can someone please help me? in Java, please.

image text in transcribed

You will need two classes: 1. Linkedlist class, which will represent the full list. 2. Node class. containing a #value method and a link to the #next node . Set both as nil by default. Build the following methods in your linked list class 1. #append adds a new node to the end of the list 2. #prepend adds a new node to the start of the list 3. #size returns the total number of nodes in the list 4. #head returns the first node in the list 5. #tail returns the last node in the list 6. #at (index) returns the node at the given index 7. #pop removes the last element from the list 8. #contains? returns true if the passed in value is in the list and otherwise returns false. 9#find (data) returns the index of the node containing data, or nil if not found. 10. #to_s represent your LinkedList objects as strings, so you can print them out and preview them in the console. The format should be: ( data ) ( data ) .> ( data ) .> nil ### Extra Credit 1. (tinsert at(index)) that inserts the node at the given index 2. #remove-at(index) that removes the node at the given index. (You will need to update the links of your nodes in the list when you remove a node.)

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Database Design For Mere Mortals

Authors: Michael J Hernandez

4th Edition

978-0136788041

More Books

Students also viewed these Databases questions

Question

Briefly describe the five principles of succession planning.

Answered: 1 week ago

Question

What are the disadvantages of succession planning?

Answered: 1 week ago