help me finish the add(int index, E value)method on handwrit
Need help with this assignment?Get an original answer from a qualified tutor — from $10/page.
Get it written →help me finish the add(int index, E value)method on handwritten linked list. The code in the attatchmentAdd a method void add(int index, E value) which adds a new node at the indexth spot in listThe algorithm is the following:create a new node with value in itif head is null, the list is empty, so just set head and tail to the new nodeIf head is not null, loop to the node in front of where you want to put the new node (see toString() for a model of looping through a linked list). Then set the new node’s next pointer to the next node ahead, and the previous node’s next pointer to the new node. Reassign tail if necessary.
Get a plagiarism-free answer to this question
Send us your instructions and we’ll match you with the best writer in your subject.
- 100% human-written, zero AI
- Turnitin report included
- Confidential — we never share your data
- Free revisions & refunds