What is a tree?
A tree is a connected, undirected graph with no cycles.
What is a characteristic that not all trees have?
Not all trees have roots!
What is a rooted tree?
A tree where one node has been designated as the root.
What is a binary tree?
A rooted tree where each parent node has at most two child nodes.
What is a binary search tree?
An ordered binary tree.
Which item in a line of items is the root?
The first item that is entered is always the root!
Searching for an item in a binary search tree.
Just like a binary search, searching for an item in a binary tree is an O(logn) process.
This is because, on each attempt, the size of the list halves.
How do you represent a binary tree?
Binary trees can be represented using three arrays.
One stores the data for each node, one stores the left pointers, and one stores the right pointers.
Pointers are stored at the same location in the arrays as corresponding data item.