a) Write in pseudocode an algorithm that receives as input the root of a tree and it returns true if the tree is a proper binary tree (i.e. each internal node has 2 children) and false otherwise. Assume that r.children is the number of children of a node r. For example, for the tree below with root A the algorithm must return the value true, and for the tree with root B it must return the value false.
b) Compute time complexity in worst case as function of the number n nodes and give order.