Design a divide-and-conquer algorithm in pseudocode for computing the number of levels in a binary tree. In particular, your algorithm must return 0 and 1 for the empty and single-node trees, respectively. What is the time efficiency class of your algorithm?
if x = nil:
lSubTreeLevel = BinaryTreeLevel(x.leftSubtree)
rSubTreeLevel = BinaryTreeLevel(x.rightSubtree)
if lSubTreeLevel > rSubTreeLevel:
return lSubTreeLevel + 1
return rSubTreeLevel + 1
in each recursive call,