Using the binarytreenode Picture above Write a recursive fun
Using the binary_tree_node (Picture above), Write a recursive function to meet the following specification. You do not need to check the precondition.
..................................................
Using the binary_tree_node from page (picture above) write a recursive function to meet the following specification. You do not need to check the precondition.
class, stack class, au We will start with only two funcUILJ FIGURE 10.6 The Binary Tree Node Definition Class Definition template class binary_tree_node public: / TYPEDEF typedef Item value type; // CONSTRUCTOR binary tree_node( const Item& init_data = Item( ), binary-tree-node* init_1 eft = NULL, binary tree_node* init.right NULL data-field- 1 eft-field right-field = init-data; i ni t-left; = init-right; // MODIFICATION MEMBER FUNCTIONS Item& data() return data_field; binary tree_node*& leftC) return left field; binary tree_node*& right( return right field; b void set_data(const Item& new_data) f data field new_data; void set left(binary_tree_node* new left) left field - newleft: void set-right(binary-tree-node* new-right) { right-field = new-right // CONSTANT MEMBER FUNCTIONS const Item& data() const f return data field; nst binary tree_node* left() co nst treturn left field; const binary-t const binary tree.node* right( const t return right field; bool isleaf() const return (left field NUL (right-field == NULL); } L) && private: Item data field; binary tree_node *left field: binary-tree-nod e right field; 3: www.cs.colorado.edu/-main/chapter10/bin tree.hSolution
public class Node<T extends Comparable<T>> {
 
 Node Left, Right;
 T Value;
 
 public Node(T Value) {
 this.Value = Value;
 }
 }
public int count(Node<T> root) {
 if (root == null) {
 return 0;
 }
 
 return count(root.Left) + count(root.Right) + 1;
 }
 
 public void increase(Binary_Tree_Node<Item>* root_ptr) {
 if (root == null) {
 return;
 }
 
 root.Value += 1;
 
 increase(root.Left);
 increase(root.Right);
 }
{
if(root_ptr =0) {
tree_depth=-1;
elseif(root_prt=1) {
tree_depth=0;
else {
return tree_depth(root_ptr);
}
}
tree_depth(root.height);
}


