Question: Assignment description Implement the following 2 functions and put your code for 2 functions in a single file called homework 4 . cpp . (

Assignment description
Implement the following 2 functions and put your code for 2 functions in a single file called homework4.cpp.(Note: you can define your own function that are called by these 2 functions)
Also include the following definition of node class in your homework4.cpp: class tree_node { public: int data; tree_node *left,*right; tree_node(int d,tree_node ?**= NULL, tree_node ?**r= NULL) data =d; left =l; right {:=r;};
Function 1: int sumleaves(tree_node ?***); ?*********** This function returns the sum of all leaves of a tree with root r.
Function 2: int depthnegative tree_node ?***r); ?********** this function returns the depth of a tree node with value -1 in a tree with root r. This tree contains exactly one -1. Your goal is to figure out the depth of the tree node that contains -1.
Assignment description Implement the following 2

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Accounting Questions!