Question: Reimplement the addNode method of the Node class in BinarySearchTree as a static method of the BinarySearchTree class: If parent is null, return newNode. Otherwise,
Reimplement the addNode method of the Node class in BinarySearchTree as a static method of the BinarySearchTree class:
![]()
If parent is null, return newNode. Otherwise, recursively add newNode to parent and return parent. Your implementation should replace the three null checks in the add and original addNode methods with just one null check.
private static Node addNode (Node parent, Node newNode)
Step by Step Solution
3.58 Rating (158 Votes )
There are 3 Steps involved in it
In the image provided I see a method signature indicating that you wish to implement the addNode method as a static method of the BinarySearchTree cla... View full answer
Get step-by-step solutions from verified subject matter experts
