Data Structures: Tree Basics
A tree is a non-linear hierarchical data structure consisting of nodes connected by edges. Hover over nodes to see their terminology.
Hover over a node to see terminology…
N-ary Trees
A tree where a node can have at most N children. This example shows a 4-ary tree.
Binary Trees
A tree where each node has at most two children, referred to as the left child and the right child.
References
- C. to, “class of algorithms,” Wikipedia.org, Apr. 15, 2004. https://en.wikipedia.org/wiki/Tree_traversal.
- Bruno R. Preiss, Data structures and algorithms with object-oriented design patterns in C++. John Wiley & Sons, Inc., 605 Third Ave. New York, NY, United States, August 1998.