Lesson 1 Flashcards

1
Q

Named after their inventor_, _are height balancing binary search tree. _ checks the height of the left and the right sub-trees and assures that the difference is not more than 1. This difference is called the Balance Factor.

A

Adelson- Velski & Landis
AVL trees

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

AVL Rotations
To balance itself, an AVL tree may perform the following four kinds of rotations −

A
  • Left rotation
  • Right rotation
  • Left-Right rotation
  • Right-Left rotation
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

If a tree becomes unbalanced, when a node is inserted into the right subtree of the right subtree.

A

LEFT ROTATION

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

AVL tree may become unbalanced, if a node is inserted in the left subtree of the left subtree.

A

RIGHT ROTATION

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

Double rotations are slightly complex version of already explained versions of rotations. To understand them better, we should take note of each action performed while rotation.

A

LEFT-RIGHT ROTATION

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

The second type of double rotation is _ Rotation. It is a combination of right rotation followed by left rotation.

A

RIGHT-LEFT ROTATION

How well did you know this?
1
Not at all
2
3
4
5
Perfectly