Representation of Binary Tree

Binary Tree Representation

Each node of a binary tree has the following 3 parts:

  • Data
  • Pointer to left child node
  • Pointer to right child node

Binary Tree- Node Representation

To create a binary tree, we have to first create a node having a data, pointer to left child and pointer to right child using the below structure format:

struct node
{
int data;
struct node *left;
struct node *right;
};

Binary Tree in C

A binary tree is a non-linear hierarchical data structure in which each node has at most two children known as the left child and the right child. It can be visualized as a hierarchical structure where the topmost node is called the root node and the nodes at the bottom are called leaf nodes or leaves.

In this article, we will learn the basics of binary trees, types of binary trees, basic operations that can be performed on binary trees as well as applications, advantages, and disadvantages of binary trees in C.

Similar Reads

Representation of Binary Tree

Binary Tree Representation...

Basic Operations on Binary Tree in C

The following are the basics operations that can performed on a binary tree:...

C Program to Implement Binary Tree

The below program demonstrates all the basic operations on a binary search tree: creation, searching, traversal, insertion and deletion in C....

Types of Binary Trees in C

Binary trees can be of many types depending on the parameter we took for the classification of the trees. The following are the types of binary trees:...

Applications of Binary Trees

Binary tree are the versatile data structure widely used in the various applications due to the hierarchical nature and efficient performance in the certain operations. Following are some applications of the binary tree:...

Frequently Asked Questions on C Binary Tree

What is a binary tree?...