Google Interview Question: Find the deepest node of a bi... |

Interview Question

Software Engineer Interview

Find the deepest node of a binary tree. If multiple nodes

  are at the deepest level, then return the rightmost node.

Interview Answer

1 Answer


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

Anonymous on 28 Nov 2014

Add Answers or Comments

To comment on this, Sign In or Sign Up.