Binary Trees Flashcards
What is a tree?
A form of non-linear organization datatype. “A collection of nodes connected by edges without having any cycle”.
What are the two main types of data organization?
Linear: entries/objects one after another.
Non-linear: entries/objects arranged in a hierarchy.
Level
The hierarchical level of a node.
Root
The single node at the top level.
Children
The nodes at each successive level of a tree are the children of the nodes at the previous level.
Parent
A node that has children is the parent of those children.
Leaf
A node that has no children.
Subtree
Any node and its descendants form a subtree of the original tree.
Sibling
Sibling nodes share the same parent node.
Edge
Connection between one node to another.
Path
A sequence of nodes and edges connecting a node with a descendant.
Height of node
The height of a node is the # of edges on the longest path between that node and a leaf + 1
Depth of node
The depth of a node is the # of edges from the tree’s root node to the node + 1
Height of tree
The height of a tree is the height of its root node.