Skip to content
geeksforgeeks
  • Courses
    • DSA to Development
    • Get IBM Certification
    • Newly Launched!
      • Master Django Framework
      • Become AWS Certified
    • For Working Professionals
      • Interview 101: DSA & System Design
      • Data Science Training Program
      • JAVA Backend Development (Live)
      • DevOps Engineering (LIVE)
      • Data Structures & Algorithms in Python
    • For Students
      • Placement Preparation Course
      • Data Science (Live)
      • Data Structure & Algorithm-Self Paced (C++/JAVA)
      • Master Competitive Programming (Live)
      • Full Stack Development with React & Node JS (Live)
    • Full Stack Development
    • Data Science Program
    • All Courses
  • Tutorials
    • Data Structures & Algorithms
    • ML & Data Science
    • Interview Corner
    • Programming Languages
    • Web Development
    • CS Subjects
    • DevOps And Linux
    • School Learning
  • Practice
    • Build your AI Agent
    • GfG 160
    • Problem of the Day
    • Practice Coding Problems
    • GfG SDE Sheet
  • Contests
    • Accenture Hackathon (Ending Soon!)
    • GfG Weekly [Rated Contest]
    • Job-A-Thon Hiring Challenge
    • All Contests and Events
  • DSA
  • Interview Problems on Tree
  • Practice Tree
  • MCQs on Tree
  • Tutorial on Tree
  • Types of Trees
  • Basic operations
  • Tree Traversal
  • Binary Tree
  • Complete Binary Tree
  • Ternary Tree
  • Binary Search Tree
  • Red-Black Tree
  • AVL Tree
  • Full Binary Tree
  • B-Tree
  • Advantages & Disadvantages
Open In App
Next Article:
What is Binary Search Tree
Next article icon

What is Binary Tree?

Last Updated : 02 Mar, 2023
Comments
Improve
Suggest changes
Like Article
Like
Report

A binary tree is a type of tree data structure in which each node can have at most two child nodes, known as the left child and the right child. Each node of the tree consists of - data and pointers to the left and the right child.

Example of Binary Tree
Example of Binary Tree

Properties of a Binary Tree:

The following are some of the important properties of a binary tree:

  • A binary tree allows for a maximum of two children per node.
  • The maximum number of edges between the root and a leaf node determines the height of a binary tree. 
  • A binary tree can have a maximum of 2d nodes at depth d.
  • A binary tree of height h can have a maximum of 2(h+1) - 1 nodes.
  • In a binary tree, there can only be as many leaf nodes as internal nodes plus one.

To learn more about the properties of binary trees, refer to this article.

Types of Binary Trees:

There are several types of binary trees that are based on their properties-

Binary Tree based on the number of children:

  • Full Binary Tree
  • Degenerate Binary Tree
  • Skewed binary tree

Binary Tree based on the completion of levels:

  • Complete binary tree
  • Balanced binary tree
  • Perfect binary tree

To learn more about the types of binary trees refer to this article.

Applications of Binary Tree

Binary trees have a wide range of applications in computer science and other fields. Some of the common applications of binary trees include:

  • Expression evaluation: In order to evaluate arithmetic expressions, binary trees are used.
  • Data compression: The widely used data compression method known as Huffman coding uses binary trees to describe the frequency of characters in a message.
  • Decision-making processes: Binary trees may be utilized in decision-making procedures such as game trees and decision trees.
  • Network routing: To effectively route packets via a network, network routing methods use binary trees for the transfer of packet.
  • Machine learning:  Binary trees are utilized in machine learning techniques like decision trees and random forests to model and classify the data.

To learn more about the applications of binary trees, refer to this article.

Advantages of binary tree:

  • Effective searching and sorting: Binary trees are useful in a variety of applications because they offer effective searching and sorting operations.
  • Memory efficiency: Because binary trees use less memory than other tree structures like multi-way trees or linked lists, they are a viable option for huge data sets.
  • Fast insertion: As we know only a portion of the tree needs to be updated therefore binary trees enable fast element insertion.

To learn more about the advantages of binary trees, refer to this article.

Disadvantages of binary tree:

  • Limited structure: Binary trees can only have two child nodes per node, which can restrict their versatility and usefulness in some applications.
  • Difficult to implement: It needs close attention to the node ordering and tree structure, implementing a binary tree can be difficult.
  • Inefficient for some operations: Some of the operations like finding the minimum or maximum value in a binary tree, can be less efficient and require additional steps and complexity to perform.

To learn more disadvantages of binary trees, refer to this article.

What else can you read?

  • Introduction to Binary Tree - Data Structure and Algorithms Tutorials
  • Types of Binary Tree
  • Binary Tree Traversals
  • Properties of Binary Tree

Next Article
What is Binary Search Tree

S

sundaram1527
Improve
Article Tags :
  • Tree
  • DSA
  • Definitions and Meanings
  • Binary Tree
Practice Tags :
  • Tree

Similar Reads

  • What is Full Binary Tree?
    A full binary tree is a type of binary tree in which every node has either zero or two children. Properties of Full Binary Tree: Let i be the number of internal nodes, n be the total number of nodes, l be the number of leaf nodes and h be the total number of levels The number of leaves is (i + 1).Th
    2 min read
  • What is Binary Search Tree
    A binary search tree (BST) is a binary tree in which the left subtree of a node contains only nodes with less value and the right subtree of a node contains only nodes with values greater than it. Characteristics of Binary Search Tree: The properties of a binary search tree are as follows: Ordering
    3 min read
  • What is Ternary Tree?
    A Ternary Tree is a special type of tree data structure. Unlike a regular binary tree where each node can have up to two child nodes. The article explains the basic structure and properties of ternary trees, such as the number of possible children per node, tree height, and node depth. It also discu
    4 min read
  • 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 leav
    12 min read
  • What is Binary Heap
    Binary heap is a complete binary tree where the root of any subtree has a higher (or lower based on the type of heap) value than all the nodes in its subtree. Characteristics of Binary Heap: The following are the properties of a binary heap: It is a complete binary tree, which means that all levels
    2 min read
  • Types of Binary Tree
    We have discussed Introduction to Binary Tree in set 1 and the Properties of Binary Tree in Set 2. In this post, common types of Binary Trees are discussed. Types of Binary Tree based on the number of children:Following are the types of Binary Tree based on the number of children: Full Binary TreeDe
    7 min read
  • Binary Search Tree
    A Binary Search Tree (or BST) is a data structure used in computer science for organizing and storing data in a sorted manner. Each node in a Binary Search Tree has at most two children, a left child and a right child, with the left child containing values less than the parent node and the right chi
    3 min read
  • Skewed Binary Tree
    A skewed binary tree is a type of binary tree in which all the nodes have only either one child or no child. Types of Skewed Binary trees There are 2 special types of skewed tree: 1. Left Skewed Binary Tree: These are those skewed binary trees in which all the nodes are having a left child or no chi
    5 min read
  • Full Binary Tree
    What is a Binary Tree?A binary tree is a tree data structure with a maximum of 2 children per node. We commonly refer to them as the left and right child as each element in a binary tree may only have two children. What is a Full Binary Tree?A full binary tree is a binary tree with either zero or tw
    2 min read
  • Threaded Binary Tree
    Inorder traversal of a Binary tree can either be done using recursion or with the use of a auxiliary stack. The idea of threaded binary trees is to make inorder traversal faster and do it without stack and without recursion. A binary tree is made threaded by making all right child pointers that woul
    10 min read
geeksforgeeks-footer-logo
Corporate & Communications Address:
A-143, 7th Floor, Sovereign Corporate Tower, Sector- 136, Noida, Uttar Pradesh (201305)
Registered Address:
K 061, Tower K, Gulshan Vivante Apartment, Sector 137, Noida, Gautam Buddh Nagar, Uttar Pradesh, 201305
GFG App on Play Store GFG App on App Store
Advertise with us
  • Company
  • About Us
  • Legal
  • Privacy Policy
  • In Media
  • Contact Us
  • Advertise with us
  • GFG Corporate Solution
  • Placement Training Program
  • Languages
  • Python
  • Java
  • C++
  • PHP
  • GoLang
  • SQL
  • R Language
  • Android Tutorial
  • Tutorials Archive
  • DSA
  • Data Structures
  • Algorithms
  • DSA for Beginners
  • Basic DSA Problems
  • DSA Roadmap
  • Top 100 DSA Interview Problems
  • DSA Roadmap by Sandeep Jain
  • All Cheat Sheets
  • Data Science & ML
  • Data Science With Python
  • Data Science For Beginner
  • Machine Learning
  • ML Maths
  • Data Visualisation
  • Pandas
  • NumPy
  • NLP
  • Deep Learning
  • Web Technologies
  • HTML
  • CSS
  • JavaScript
  • TypeScript
  • ReactJS
  • NextJS
  • Bootstrap
  • Web Design
  • Python Tutorial
  • Python Programming Examples
  • Python Projects
  • Python Tkinter
  • Python Web Scraping
  • OpenCV Tutorial
  • Python Interview Question
  • Django
  • Computer Science
  • Operating Systems
  • Computer Network
  • Database Management System
  • Software Engineering
  • Digital Logic Design
  • Engineering Maths
  • Software Development
  • Software Testing
  • DevOps
  • Git
  • Linux
  • AWS
  • Docker
  • Kubernetes
  • Azure
  • GCP
  • DevOps Roadmap
  • System Design
  • High Level Design
  • Low Level Design
  • UML Diagrams
  • Interview Guide
  • Design Patterns
  • OOAD
  • System Design Bootcamp
  • Interview Questions
  • Inteview Preparation
  • Competitive Programming
  • Top DS or Algo for CP
  • Company-Wise Recruitment Process
  • Company-Wise Preparation
  • Aptitude Preparation
  • Puzzles
  • School Subjects
  • Mathematics
  • Physics
  • Chemistry
  • Biology
  • Social Science
  • English Grammar
  • Commerce
  • World GK
  • GeeksforGeeks Videos
  • DSA
  • Python
  • Java
  • C++
  • Web Development
  • Data Science
  • CS Subjects
@GeeksforGeeks, Sanchhaya Education Private Limited, All rights reserved
We use cookies to ensure you have the best browsing experience on our website. By using our site, you acknowledge that you have read and understood our Cookie Policy & Privacy Policy
Lightbox
Improvement
Suggest Changes
Help us improve. Share your suggestions to enhance the article. Contribute your expertise and make a difference in the GeeksforGeeks portal.
geeksforgeeks-suggest-icon
Create Improvement
Enhance the article with your expertise. Contribute to the GeeksforGeeks community and help create better learning resources for all.
geeksforgeeks-improvement-icon
Suggest Changes
min 4 words, max Words Limit:1000

Thank You!

Your suggestions are valuable to us.

What kind of Experience do you want to share?

Interview Experiences
Admission Experiences
Career Journeys
Work Experiences
Campus Experiences
Competitive Exam Experiences