Question: JAVA - Write a function on your LinkedList class Node getParent(Node node)- given a Node in a LinkedList, finds and returns its parent. Return null
JAVA - Write a function on your LinkedList class Node
- For a LinkedList
with values "A" -> "B" -> "C" -> "D", getParent(node "B") returns node "A" - For a LinkedList
with values "A" -> "B" -> "C" -> "D", getParent(node "A") returns null - For a LinkedList
with values "A" -> "B" -> "C" -> "D", getParent(node "E") throws NoSuchElementException
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
