C Program to check if a Binary tree is AVL Tree or Not

By | May 10, 2017

Check Binary tree is AVL Tree or Not


Write a C Program to check if a Binary tree is AVL Tree or Not. Here’s simple Program to check if a Binary tree is AVL Tree or Not in C Programming Language.


AVL Tree


AVL tree is a self balanced binary search tree. That means, an AVL tree is also a binary search tree but it is a balanced tree. A binary tree is said to be balanced, if the difference between the heights of left and right subtrees of every node in the tree is either -1, 0 or +1.

In other words, a binary tree is said to be balanced if for every node, height of its children differ by at most one. In an AVL tree, every node maintains a extra information known as balance factor.

Balance factor of a node is the difference between the heights of left and right subtrees of that node. The balance factor of a node is calculated either height of left subtree – height of right subtree (OR) height of right subtree – height of left subtree.

  • Balance factor = heightOfLeftSubtree – heightOfRightSubtree

Also Read : : C Program to implement AVL Tree and its operations

Below is the source code for C Program to check if a Binary tree is AVL Tree or Not which is successfully compiled and run on Windows System to produce desired output as shown below :


SOURCE CODE : :



OUTPUT : :



If you found any error or any queries related to the above program or any questions or reviews , you wanna to ask from us ,you may Contact Us through our contact Page or you can also comment below in the comment section.We will try our best to reach up to you in short interval.


Thanks for reading the post…


You may Also Read : :

Leave a Reply