Google Interview Question

Find the deepest node of a binary tree. If multiple nodes are at the deepest level, then return the rightmost node.

Interview Answer

Anonymous

Nov 29, 2014

it actually just sounds like a BFS, then return the last node you popped - assuming you enqueued left then right.