Domanda di colloquio di Microsoft

Find the max int in an onordered binary tree.

Risposte di colloquio

Anonimo

26 mar 2012

Why would you need to store all of the integers in an array? You only need to keep track of the max value seen at each node. Creating an array doubles the space you need.

5

Anonimo

25 mar 2012

step1 you a tranverse the binary tree & save the integers in a array. step2: pick the greatest one RUNNING time O(n) + O(n) ~ O(n)