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

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.
Answer

Interview Answer

1 Answer

0

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.