Microsoft interview question

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

Interview Answer

Anonymous

18 May 2015

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

2