Understanding a binary tree
A tree is a nonlinear data structure that stores elements hierarchically. Every element in a tree is called a node, and except the topmost node, each node has a parent node and zero or more child nodes. The individual nodes in a tree are connected by edges, which may be unidirectional (only parent to child) or bidirectional (both directions). A tree can only have edges between a parent and a child node, so it cannot have cycles (no path of edges loops back to a node it already visited).
Representation of a tree
The definition of a tree above has many terms like parent, children, etc. We will learn more about these terminologies in this lesson.
Liking the course? Check our discounted plans to continue learning.