Google Interview Question: Implement a binary tree and e... | Glassdoor

Interview Question

Software Engineer In Test Interview Mountain View, CA

Implement a binary tree and explain it's function


Interview Answer

4 Answers


Binary Search tree is a storage data structure that allows log(n) insertion time, log(n) search, given a balanced binary search tree. The following implementation assumes an integer bst.

There's a million implementations. Just look on wikipedia for search and insert algorithms.

Xin Li on May 9, 2009

Hi Xin Li,
A binary tree is not the same as binary search tree.. A binary tree is a tree in which every node has atmost two children nodes. It is a k-ary tree in which k=2.
A complete binary tree is a tree in which all nodes have the same depth.

Anonymous on Jan 11, 2011

The fact is ttttttt t t. T to t. To. A a aaAs Sdsassss.

Anonymous on Aug 24, 2016

One or more comments have been removed.
Please see our Community Guidelines or Terms of Service for more information.

Add Answers or Comments

To comment on this, Sign In or Sign Up.