Domanda di colloquio di Amazon

Connect nodes at the same level in a binary tree

Risposte di colloquio

Anonimo

22 feb 2016

2 Queues, one for current, one for parents....had little time, like 5 minutes to solve it so I did not put much into it, just came up with a working solution

Anonimo

21 lug 2016

Use a Queue for level order traversal and keep track of the level you are on (can get messy) and create a new List whenever you traverse to the next level in the tree.

Anonimo

14 mag 2016

Level Order Traversal May be ?