Search results for binary tree



Answer Binary search tree (BST) is a binary tree which has the following properties: 1. Tree is a binary tree 2. The left subtree of a node conta ...
Company where asked this question: Amazon
Interviewed for position: SDE, SDET
Answer: Hash tables (hash maps) - is amortized constant-time access data structures that map keys to values. Binary Trees - is a tree data structur ...
How would you implement Iterator Pattern for traversing Binary Tree (in any order of your choice)? So, the following would give an example of using s ...
Company where asked this question: Amazon (Seattle)
Full question: You have a vector of signed integers and you need to support an API with two exposed methods, insert(int) and getmedian(). Describe a ...
Interviewed for position: SDE
The question is tricky as you need to veify if interviewer is talking about balanced or unbalanced search tree. The best case performance for a bala ...
Answer The solution, while being extremely simple, sometimes confuses many people because of the necessity of maintaining an array index for the nex ...
class Node { public Node Right; public Node Left; public int Key; public String Value; } Write a function which will search a given BST for ...
Question is usually something like explain BST or Binary Search Tree.   Answer:   A binary search tree (BST) is a tree in which every node's ...