BinaryTrees Flashcards
1
Q
What are the parts of a binary tree?
A
A node – the value.
A leaf – a node whose subtrees are empty.
An internal node – not a leaf.
Root node – node that has no parent.
2
Q
What is a binary search tree?
A
From any node in the tree, the
left subtree contains only values
that come before…
…and the right subtree contains
only values that come after.
3
Q
What is a balanced tree?
A
Same number of nodes in left as right, referred to as bushy.
4
Q
What is an unbalanced tree?
A
More nodes in one subtree, branchy, extreme case is a list!