## Introduction to trees

A tree is an acyclic graph, a tree of which each vertex has at most 2 children is called a binary tree.

Since each vertex of a binary tree can only have 2 children, we generally name them left child (under left tree) and right child (under right tree).

Unlike tables, linked lists, stacks, and queues, which are linear data structures, trees are hierarchical data structures.

The highest node is called the root of the tree (root). Items that are directly under an item are called its children. The element directly above something is called its parent. For example, "D" is a child of "B" and "B" is the parent of "D".

Finally, the elements without children are called leaves (D, E, F, G).

#### Why trees?

#### Main applications of trees

#### Binary Tree Representation

A tree is represented by a pointer to the highest node in the tree. If the tree is empty, the value of the root is zero.

A node contains the following elements:

###### Implementation

#### Share this course with your friends :

**This course is written by M. ESSADDOUKI Mostafa**

## 0 Comment(s)