level: Tree
Questions and Answers List
level questions: Tree
Question | Answer |
---|---|
Whats the difference between a graph and a tree | A tree has no cycles Trees are always conneced Trees are always undirected |
Whats the main feature of a binary tree | Each node has a maximum of two children |
Describe two advantages of using a binary search tree to store data | 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 |
Whats special about a non rooted tree | Donest have a clear starting point |
State the defining factors of a rooted tree as stated by the spec | One vertex has been designated as the root. Parent-child relationships between nodes The root is the only node with no parent and all other nodes are descendants of the root. |
What are typical uses of rooted trees | Represent hierarchal structure so: - Family trees - chapters in book Binary search trees When compiling program code as they can be used to process the syntax of statements |
Whats a common apllicton of a binary treee | Binary search tree |
Are trees static or dynamic | Dynamic |