Question d’entretien chez Microsoft

Find the max int in an onordered binary tree.

Réponses aux questions d'entretien

Utilisateur anonyme

26 mars 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

Utilisateur anonyme

25 mars 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)