### Binary Tree

#### binary tree tree data structure data structure

Reading time: 10 minutes | Coding time: 5 minutes

A binary tree is a tree data structure in which each node has upto two children (that is a maximum of two children nodes), which are referred to as the left child and the right child. Node representation is as follows:

The representation of Binary Tree is as follows:

### Pseudocode

Pseudocode of node of a binary tree is as follows:


class Node
{
int key;
int val;
BinaryTree left = new BinaryTree();
BinaryTree right = new BinaryTree();
Node (int k, int v)
{
key = k; val = v;
}
}


### Implementations

Implementations of Binary Tree is as follows:

• Java

### Java


public class Binary_Tree
{
{
Node node = null;
}
private class Node
{
int key;
int val;
Node (int k, int v)
{
key = k; val = v;
}
}
}


### Applications

Applications of Binary Tree is as follows:

• Manipulate hierarchical data
• Make information easy to search
• Manipulate sorted lists of data
• As a workflow for compositing digital images for visual effects
• Router algorithms
• Form of a multi-stage decision-making

#### OpenGenus Foundation

The official account of OpenGenus IQ