Starting from:

$35

Homework Project 2 Solution




Take the height-balanced tree code, and add a function int depth distribution(tree node t *tree);







which prints the total number of leaves, and a table giving the number of leaves at different depths. The depth of a tree node is the distance from the root, so the root has depth 0. Send only the code of your function, do not include my height-balanced tree code. The programming language is C or C++; test your code before submission using the gcc or g++ compiler. Please remove all dead code; try to program as clearly as possible, since I try to read it. Do not copy code from another student or from the web; this is an easy project, and must be all your own work.




Submit your source code by e-mail to phjmbrass@gmail.com; include the course




 
and homework number in the subject line, and your name as a comment in the homework file.

More products