answersLogoWhite

0

You can find the balance factor of a node by finding the difference in height of its children.

User Avatar

Wiki User

15y ago

What else can I help you with?

Related Questions

How can you know balance factor of height balance tree?

we can find the balance factor of highty balance tree with height of left subtree- height of right sub tree


Program for insertion and deletion operations in AVL tree?

Here is a high-level overview of insertion and deletion operations in an AVL tree: Insertion: Perform a standard BST insertion. Update the height of each node as the new node is inserted. Perform rotations if the balance factor of any node becomes greater than 1 or less than -1. Deletion: Perform a standard BST deletion. Update the height of each node as the node is deleted. Perform rotations if the balance factor of any node becomes greater than 1 or less than -1 to rebalance the tree.


How to find the mirror image of a binary tree?

Refer to http://cslibrary.stanford.edu/110/BinaryTrees.html void mirror(struct node* node) { if (node==NULL) { return; } else { struct node* temp; // do the subtrees mirror(node->left); mirror(node->right); // swap the pointers in this node temp = node->left; node->left = node->right; node->right = temp; } }


What is the algorithm to find largest node in a binary search tree?

Since a binary search tree is ordered to start with, to find the largest node simply traverse the tree from the root, choosing only the right node (assuming right is greater and left is less) until you reach a node with no right node. You will then be at the largest node.for (node=root; node!= NULL&&node->right != NULL; node=node->right);This loop will do this. There is no body because all the work is done in the control expressions.


What is branching factor in trees?

In computing, tree data structures, and game theory, the branching factor is the number of children at each node


What do you mean by re balancing of AVL tree?

AVL tree definition a binary tree in which the maximum difference in the height of any node's right and left sub-trees is 1 (called the balance factor) balance factor = height(right) - height(left) AVL trees are usually not perfectly balanced however, the biggest difference in any two branch lengths will be no more than one level


How can i find last node of a cicular list whose size i don't know and the last node points to any other node except first node of the link list through c plus plus language of data structure?

How can i find last node of a cicular list whose size i don't know and the last node points to any other node except first node of the link list through c plus plus language of data stucture?


How do you find out the first node in a list?

The first node in a list is something that you need to keep track of explicitly. While it's possible to find any other node given the first, you must have a starting point stored somewhere.


How do you delete a node in linklist without traversing?

If you don't already have a reference to the node, there is no way to avoid traversing the list to find it.


Steps of algorithum for delete node in linklist?

To delete a node (this) in a linked list, first you need to find the address of the parent node (parent).Iterate through the list, checking to find if the head pointer (head) or a child node (parent) points to (this).Store the next pointer of (this) in (parent) or (head), as determined by step 2.Delete (this).


What is a balanced factor in data structure?

We use the term balance when referring to balanced binary trees. These are typically implemented using red/black trees, thus ensuring every parent node has as many nodes under the left branch as it has under the right branch.


What conversion factor can be used to convert the number of blocks to the weight of the blocks in pounds?

Are used to balance scale to find the conversion factor that can be used to convert the number of blocks to the weight of the blocks in pounds