Given a binary tree. Print the greatest element for each path from root to leaves.
Anonymous
Solutions is based on using modified depth first search (DFS). In addition we need to save current maximum at each visited node.
Check out your Company Bowl for anonymous work chats.