Binary Search Trees Flashcards
1
Q
What is a binary search tree?
A
A Binary Search Tree is a binary tree where the items are stored
in a way that makes it easy to find them
A binary search tree is a binary tree where for every node, if it
is not a leaf node,
all the descendents in its left sub-tree have smaller values
than it and
all the descendents in its right sub-tree have larger values
than it.
2
Q
Name the four cases for removal
A
The node to be deleted is not in the tree.
The node to be deleted is a leaf node.
The node to be deleted has one child.
The node to be deleted has two children
3
Q
What is a perfect binary search tree?
A
When the height of the tree is the smallest possible.