Tree is a widely used abstract data type that simulates a hierarchical tree structure, with a root value and subtrees of children with a parent node, represented as a set of linked nodes.

A tree consists of nodes (vertices) that are connected using pointers (edges). Trees are similar to Graphs; the key differentiating point is that a cycle cannot exist in a Tree.

The basic structure of a tree consists of the following components:

https://s3-us-west-2.amazonaws.com/secure.notion-static.com/8ec9f12b-79d1-4e72-bb23-7075b001e14e/Untitled.png

Terminology Used in Trees

Here are some other common terminologies used in trees:

https://s3-us-west-2.amazonaws.com/secure.notion-static.com/9f34dc50-36c1-437c-8943-bac3ec1f8e84/Untitled.png