Question: Question 3 a) Given a tree T, where n is the number of nodes of T. Give an algorithm for computing the depths of all

Question 3 a) Given a tree T, where n is the number of nodes of T. Give an algorithm for computing the depths of all the nodes of a tree T. What is the complexity of your algorithm in terms of Big-O? b) We say that a node in a binary search tree is full if it has both a left and a right child. Write an algorithm called Count-Full-Nodes (t) that takes a binary search tree rooted at node t, and returns the number of full nodes in the tree. What is the complexity of your solution
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
