Microsoft Interview Question

Given a binary tree. Print the greatest element for each path from root to leaves.

Interview Answer

Anonymous

May 18, 2015

Solutions is based on using modified depth first search (DFS). In addition we need to save current maximum at each visited node.

2