Write Recursive Method Remove Int Target Llnode List Removes Occurrences Target List Retur Q37055317

Write a recursive method remove(int target, LLNode list) thatremoves all occurrences of target from list and returns a referenceto the new list. For our example list the statement values =remove(6, values); would result in values referencing the listcontaining 3 9 12 15 18 19 19 and 20. If target is not contained inlist then the list remains unchanged. Please also add a driverclass to demonstrate that the method is working correctly.

LLNode.java

//—————————————————————————-
// LLNode.java by Dale/Joyce/Weems Chapter 2
//
// Implements <T> nodes for a Linked List.
//—————————————————————————-
package support;

public class LLNode<T>
{
protected LLNode<T> link;
protected T info;

public LLNode(T info)
{
this.info = info;
link = null;
}

public void setInfo(T info){ this.info

OR
OR

Leave a Comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.