Question 12
Consider the following class Node:
Consider an implementation of a linked list where each node is created using the given class Node. Suppose head points to the first node of the linked list. Assume that the linked list is in sorted order.
What is an efficient way to remove all duplicate values in the linked list?
Recursively remove duplicates from the tail of the linked list.
Iterate through the linked list and use a nested loop to find duplicate values.
Traverse the linked list once, comparing each node with its immediate successor.
Traverse the linked list once and store non-duplicate elements in a new linked list.