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
Search results for binary tree
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)
Company where asked this question: Amazon (Seattle)
Design an alogrithms and data structure to retrieve median of vector (array) in constant time.
Posted by aleksin
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
Interviewed for position: SDE
Write a function which will insert a number into the correct location of the Binary Search Tree
Posted by CMaster
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 ...
Write a function which will search a given BST for a specific key and return a Value for the found node
Posted by CMaster
class Node
{
public Node Right;
public Node Left;
public int Key;
public String Value;
}
Write a function which will search a given BST for ...
