Trees Flashcards
1
Q
What is a tree?
A
A graph that has no cycles (not possible to loop back around to a previous part of the tree) and is not disconnected
2
Q
What is a rooted tree?
A
A tree with a rooted node from which all edges leading away from that root
3
Q
What is a binary tree?
A
A tree that each node has a maximum of two children
4
Q
What are the advantages of using a binary search tree to store data
A
Values are stored in the tree in order, no matter what order the values are added
The values don’t need to be re-sorted each time a new
value is added
A binary search can be performed easily without needing to sort the values