Question: Write a recursive and efficient algorithm that counts the number of nodes in a given binary tree at height h = 1, and prints the
Write a recursive and efficient algorithm that counts the number of nodes in a given binary tree at height h = 1, and prints the final count. (Note: a leaf node has height zero). You may assume that the binary tree, MyBinTree, does already exist and has n nodes.
Alos, give the worst case time complexity in terms of n.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
