I had an exam with the following question I couldn't answer: We have a binary tree where each node has a certain height(from bottom) and a certain depth(from root). We start counting both from zero; for example: For a tree with a root with a single child, the depth of the child would be 1 and the height would be 0.
Find an recursive algorithm which prints all of the median nodes, that is, when a node's height is equal to its depth.
A hint was given which was: Give d(depth) as an argument for the function and the height as a return value...