A tree is a data structure that consists of nodes arranged in a hierarchy. Each node has a value and may have zero or more child nodes. The top node in a tree is called the root node.