Question: please explain what is the algorithm trying to do and draw the recursion tree thanks Algorithm E Input binary tree T Int( fn(v, T node))
Algorithm E Input binary tree T Int( fn(v, T node)) If v is leaf Then return 0 else If v has left child then I= fn(left child of v)+1 else 1 =0 If v has right child then r=fn(right child of v)+1 else r=0 Return max(1,r) A.) what this algorithm return if T is the input? B.) what is the algorithm trying to output? C.) if max is change to min what is the output? I think its 1 Please explain and draw the recursion tree too
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
