Trees Flashcards
What type of data structure is a tree?
A hierarchical data structure
What internal data structure is used in a heap?
A queue
What is a node?
The elements of a data structure
What is an edge?
The theoretical relationship between a parent and child node
What are the two special cases of nodes?
root: topmost node
leaf: bottommost node
What is the length a measure of?
The number of nodes in a path
What is the height of a tree?
The largest depth(length of path)
What is the depth?
The length from the root node to the destination
What are some common uses for trees?
- )represent family trees, like genealogy
- )represent decision making algorithms
- )represent priority queues(as a heap)
- )provide fast access to databases(as a b-tree)
What is a sub-tree?
The tree with a root node that is a descendant of the original root node.
What are the descendants of a node?
The subsequent children of a given parent node
What kind of relationship does a tree have that differs from the predecessor/successor of a list?
parent/child relationship
What are the requirements for a tree to be considered binary?
Each parent node has 2 children, a right and left node
What defines pre-order traversal?
Root-L-R
What defines post-order traversal?
L-R-Root
What defines level-order traversal?
Root-level1-level2-leveln…
What defines in-order traversal?
L-Root-R