Microsoft Interview Question

Find the max int in an onordered binary tree.

Interview Answers

Anonymous

Mar 26, 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

Anonymous

Mar 25, 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)