Question: Binary SearchTree Java This is a very basic problem with a little pointer manipulation. Write code that builds the following little 1-2-3 binary search tree...
Binary SearchTree Java
This is a very basic problem with a little pointer manipulation. Write code that builds the following little 1-2-3 binary search tree... 2 / \ 1 3 Write the code in three different ways...
a: by calling newNode() three times, and using three pointer variables
b: by calling newNode() three times, and using only one pointer variable
c: by calling insert() three times passing it the root pointer to build up the tree
also include a size() method that is a simple binary tree traversal. Given a binary tree, count the number of nodes in the tree. int size(struct node* node)
and a depth() method to compute its "maxDepth" -- the number of nodes along the longest path from the root node down to the farthest leaf node
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
