Question: Provided below are two classes: Node & LinkedList. The Node class is complete. The LinkedList class, consists of 7 functions. The search, size, is_empty and
Provided below are two classes: Node & LinkedList.
The Node class is complete.
The LinkedList class, consists of 7 functions.
The search, size, is_empty and count functions have already been completed and are correct.
The add and remove functions need to be modified so they give the required output for the test code.
While, the remove_duplicate function need to be completed from scratch.
Below is all the code and the test code w/ required results you will need to modify the add and remove functions and complete the remove_duplicate function.
Node Class:

LinkedList Class: (the add and remove functions)

LinkedList Class (The remaining functins that are correct and the remove_duplicate function which needs to be completed)

Below are the test codes and desired results for three functions (Got results are based on what the code is at the moment)
add:
Define the add function for a linked list. This should add a new node with the parameter as its value to the start of the linked list.

remove:
Define the remove function for a linked list. This should remove only the first occurrence of a node with the parameter value.

remove_duplicate:
Define the remove_duplicate function for a linked list. This should remove all nodes with the value, except for the first one found in the list.

class Node: def __init__(self, new_value): self.next-node = None def get_value(self): return self.value def get_next_node(self) return self.next_node def set value( alue self.value = new.value def set_next_node(self, new_next): self. next-node = new-next
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
