Rl rotation - avl tree, Data Structure & Algorithms

Example: (Double left rotation while a new node is added into the AVL tree (RL rotation))

2036_RL rotation - Avl tree.png

Figure: Double left rotation when a new node is inserted into the AVL tree

A node was added into the subtree C, making the tree off balance through 2 at the root. First we make a right rotation around the node 9, placing the C sub tree in the left child of 9.

Then a left rotation about the root brings node 9 (together its children) up a level and subtree A is pushed down a level (together node 7). Consequently we get correct AVL tree equal balance.

An AVL tree can be represented through the given structure:

struct avl

{

struct node *left;

int info;

int bf;

struct node *right;

};

bf is the balance factor, info is the value into the node.

Posted Date: 4/11/2013 3:24:59 AM | Location : United States







Related Discussions:- Rl rotation - avl tree, Assignment Help, Ask Question on Rl rotation - avl tree, Get Answer, Expert's Help, Rl rotation - avl tree Discussions

Write discussion on Rl rotation - avl tree
Your posts are moderated
Related Questions
merging 4 sorted files containing 50 10 25 and 15 records will take time

Q. Calculate that how many key comparisons and assignments an insertion sort makes in its worst case?        Ans: The worst case performance occurs in insertion

Q. Enumerate number of operations possible on ordered lists and arrays.  Write procedures to insert and delete an element in to array.

Merging two sequence using CREW merge

The space-complexity of the algorithm is a constant. It just needs space of three integers m, n and t. Thus, the space complexity is O(1). The time complexity based on the loop

SPARSE MATRICES Matrices along with good number of zero entries are called sparse matrices. Refer the following matrices of Figure (a)

1. In computer science, a classic problem is how to dynamically store information so as to let for quick look up. This searching problem arises frequently in dictionaries, symbol t

#question. merging 4 sorted files containing 50,10,25,15 records will take time?

Question 1. How can you find out the end of a String? Write an algorithm to find out the substring of a string. 2. Explain the insertion and deletion operation of linked lis

Define the term - Array A fixed length, ordered collection of values of same type stored in contiguous memory locations; collection may be ordered in several dimensions.