Amazon Interview Question

What is the look up time for a tree?

Interview Answers

Anonymous

Jan 28, 2014

O(log n) if it's a binary tree and balanced.

Anonymous

Jan 2, 2014

O(n) worst case without constraints. O(log n ) worst case if balanced.