Vous êtes sur la page 1sur 1

AVL Data Structure

 Binary Trees with Height of O (log2n) AVL representation of BST.


o The difference in height of the two AVL trees of any node in an AVL is at most equal to 1.
o Height-balanced 1-tree
 + BST.
o Elements/Nodes:
 Structure BST + Height-balanced-10Ture:
 Operations: Insert and Delete operations are different when compared with BST
equivalents.
 (if 0, then same balance)
 (if +. Then right sub-tree taller than 1. ) If (-), then left sub-tree is smaller.
 Insert
o 1.) performs the BST insert operation as if the tree was an ordinary BST.
o 2.) Reorganize the tree to get an AVL Tree.
 Three Cases:
 Case 1.) Find the node on the search path whose balance field is either
(-)or (+) & is closest of the new node. This node is called the pivot node.

B-Tree

 Each node, excluding the root node in a b-tree contains between d and 2d elements, where d is
the order of the tree.
 The root node contains between 1 & 2d elements. Elements are in sorted order in each node.
 Each node, except the root node has a unique parent. Each note except the leaf nodes has one
more child than the number of elements it contains.
 Designed with hard-drive efficient in mind.
 B-tree are empty initially.
o If we were to create a B-tree of order 2.

Vous aimerez peut-être aussi