Horje
How is an AVL tree different from a B-tree?

AVL Trees:

AVL tree is a self-balancing binary search tree in which each node maintain an extra factor which is called balance factor whose value is either -1, 0 or 1.

B-Tree:

A B-tree is a self – balancing tree data structure that keeps data sorted and allows searches, insertions, and deletions in O(log N)  time.

Difference between AVL Tree and B-Tree:

S.No.

AVL Trees

B-Tree

1

It is a self-balancing binary search tree It is a multi-way tree(N – ary tree).

2

Every node contains at most 2 child nodes In this tree, nodes can have multiple child nodes

3

It has a balance factor whose value is either -1, 0, or 1.

Balance factor = (height of left subtree)-(height of right subtree)

or

Balance factor = (height of right subtree)-(height of left subtree)

B-Tree is defined by the term minimum degree ‘t‘. The value of ‘t‘ depends upon disk block size.
Every node except the root must contain at least t-1 keys. The root may contain a minimum of 1 key.

4

AVL tree has a height of log(N) (Where N is the number of nodes). B-tree has a height of log(M*N) (Where ‘M’ is the order of tree and N is the number of nodes).


Reffered: https://www.geeksforgeeks.org


Tree

Related
Count nodes with sum of path made by only left child nodes at least K Count nodes with sum of path made by only left child nodes at least K
Introduction to Segment Trees Introduction to Segment Trees
Minimum time required to infect all the nodes of Binary tree Minimum time required to infect all the nodes of Binary tree
Minimize water to fill all tanks connected by given circuit Minimize water to fill all tanks connected by given circuit
Convert Binary Tree to Doubly Linked List using Morris Traversal Convert Binary Tree to Doubly Linked List using Morris Traversal

Type:
Geek
Category:
Coding
Sub Category:
Tutorial
Uploaded by:
Admin
Views:
12