Question: What does someMethod defined in the following LinkedNode class do? Hint: Drawing a diagram of a chain of three singly-linked nodes and trying to trace

What does someMethod defined in the following LinkedNode class do? Hint: Drawing a diagram of a chain of three singly-linked nodes and trying to trace the method will help you answer this question correctly. public class LinkedNode \{ protected String data; protected LinkedNode next; public LinkedNode(String data, LinkedNode next) \{ this.data = data; this.next = next; public static LinkedNode someMethod(LinkedNode head) \{ LinkedNode previous = null; LinkedNode current = head; LinkedNode next = null; while (current I = null) \{ next = current. next; current, next = previous; previous = current; current = next; head = previous; return head; \} This method returns a shallow copy of the list whose head is provided as input. This method returns a deep copy of the list whose head is provided as input. This method returns a sorted copy of the list whose head is provided as input. This method returns a reversed copy of the list whose head is provided as input
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
