Reimplement the addNode method of the Node class in BinarySearchTree as a static method of the BinarySearchTree
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, 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.
Fantastic news! We've Found the answer you've been seeking!
Step by Step Answer:
Related Book For
Question Posted: