- Trending Categories
- Data Structure
- Networking
- RDBMS
- Operating System
- Java
- iOS
- HTML
- CSS
- Android
- Python
- C Programming
- C++
- C#
- MongoDB
- MySQL
- Javascript
- PHP

- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who

# Difference Between B-tree and Binary tree

In this post, we will understand the difference between B-tree and Binary tree.

## B-tree

Here, a node can have a maximum of ‘M'(where ‘M’ is the order of the tree) child nodes.

It is also known as a sorted tree.

The nodes are present in ‘inorder’ traversal mode.

It has a height of log M N (where ‘M’ is the order of tree and N is the number of nodes).

Operations are performed on a B-Tree when data is loaded to the disk.

It is used in database management system to index code.

It can also be used to insert the data or key in a B-tree.

This is a big procedure in comparison to operations on a binary tree.

## Binary tree

Here, a node can have maximum two child nodes (they are also known as sub-trees).

It is not a sorted tree.

It can be sorted in inorder, preorder or postorder traversal.

It has a height of log2 N (base 2, log N, where N is the number of nodes).

Binary tree operations are used when data is loaded to the RAM (quicker).

Its applications include usage in Huffman coding.

It is also used in code optimization methods.

Data insertion is relatively easier in comparison to B-Tree.

- Related Questions & Answers
- Difference between Graph and Tree
- Difference Between Tree and Graph
- Rooted and Binary Tree
- What is the difference between Parse Tree and the Syntax Tree?
- Binary Tree to Binary Search Tree Conversion in C++
- Binary Indexed Tree or Fenwick Tree in C++?
- Difference between Tree Set and Hash Set in Java
- Binary Tree to Binary Search Tree Conversion using STL set C++?
- Binary Tree in Javascript
- Optimal Binary Search Tree
- C++ Program to Implement B Tree
- C++ Program to Implement B+ Tree
- The B-tree in Data Structure
- B-tree Query in Data Structure
- B-tree Insertion in Data Structure