SlideShare a Scribd company logo
Oxford University Press © 2012Data Structures Using C++ by Dr Varsha Patil
1
Oxford University Press © 2012Data Structures Using C++ by Dr Varsha Patil
2
 Indexing techniques
 B-trees which prove invaluable for problems of external
information retrieval
 A class of trees called tries, which share some properties
of table lookup
 Important uses of trees in many search techniques
Oxford University Press © 2012Data Structures Using C++ by Dr Varsha Patil
3
 A file is a collection of records, each record having one or
more fields
 The fields used to distinguish among the records are
known as keys
 File organization describes the way where the records are
stored in a file
 File organization is concerned with representing data
records on an external storage media
Oxford University Press © 2012Data Structures Using C++ by Dr Varsha Patil
4
 The file organization breaks down into two more aspects:
 Directory—for collection of indices
 File organization—for the physical organization of
records
Oxford University Press © 2012Data Structures Using C++ by Dr Varsha Patil
5
 File organization is the way records are organized on a
physical storage
 One of such organizations is sequential (ordered and
unordered)
 In this general framework, processing a query or updating
a request would proceed in two steps:
 The indices would be interrogated to determine the
parts of the physical file to be searched
 These parts of the physical file will be searched
Oxford University Press © 2012Data Structures Using C++ by Dr Varsha Patil
6
 An index, whether it is a book or a data file index (in
computer memory), is based on the basic concepts such as
keys and reference fields
 The index to a book provides a way to find a topic quickly
Oxford University Press © 2012Data Structures Using C++ by Dr Varsha Patil
7
 An index, whether it is a book or a data file index (in
computer memory), is based on the basic concepts such as
keys and reference fields
 The index to a book provides a way to find a topic quickly
Oxford University Press © 2012Data Structures Using C++ by Dr Varsha Patil
8
 This is the simplest type of index organization. It is useful
only for the primary key index of a sequentially ordered
file
 In a sequentially ordered file, the physical sequence of
records is ordered by the key, called the primary key
 The cylinder-surface index consists of a cylinder index
and several surface indexes
Oxford University Press © 2012Data Structures Using C++ by Dr Varsha Patil
9
For each cylinder, there is a surface index. If the disk has S
usable surfaces, then each surface index has s entries.
The total number of surface index entries is C.S
Emp. No. Emp. Name Cylinder Surface
1
2
3
4
5
6
7
8
Abolee
Anand
Amit
Amol
Rohit
Santosh
Saurabh
Shila
1
1
1
1
2
2
2
2
1
1
2
2
1
1
2
2
Oxford University Press © 2012Data Structures Using C++ by Dr Varsha Patil
10
Let there be two surfaces and two records stored per track.
The file is organized sequentially on the field ‘Emp. name’
The cylinder index is shown in following table
Emp. No. Highest Key Value
1
2
Amol
Shila
Oxford University Press © 2012Data Structures Using C++ by Dr Varsha Patil
11
 This method of maintaining a file and index is referred to
as ISAM (indexed sequential access method)
 It is the simplest file organization for single key files but
not useful for multiple key files
Oxford University Press © 2012Data Structures Using C++ by Dr Varsha Patil
12
 The operations related to hashed indexes are the same as
those for hash tables
Oxford University Press © 2012Data Structures Using C++ by Dr Varsha Patil
13
 A multiway search tree is a tree of order m, where each
node has utmost m children
 Fig. shows way search tree:
d e p v
w x y zrh j k lb c
qia f g m n o s t u
Oxford University Press © 2012Data Structures Using C++ by Dr Varsha Patil
14
 A B-tree is a balanced M-way tree. A node of the tree
contains many records or keys of records and pointers to
children
 To reduce disk access, the following points are applicable:
 Height is kept minimum
 All leaves are kept at the same level
 All other than leaves must have at least minimum
number of children
Oxford University Press © 2012Data Structures Using C++ by Dr Varsha Patil
15
 Definition:
 A B-tree of order m is an m-way tree with the following
properties:
 The number of keys in each internal node is one less than
the number of its non-empty children, and these keys
partition the keys in the children in the fashion of the
search tree
 All leaves are on the same level
 All internal nodes except the root have utmost m non-empty
children and at least [m/2] non-empty children
 The root is either a leaf node, or it has from two to m
children
 A leaf node contains no more than m − 1 keys
Oxford University Press © 2012Data Structures Using C++ by Dr Varsha Patil
16
Ptr1 Key1 Ptr2 Key2 Ptri Keyi …….. Keyn-1 Ptrn
X XX
X<Key1 Keyi-1<X<Keyi X>Keyn-1
Oxford University Press © 2012Data Structures Using C++ by Dr Varsha Patil
17
 Search a node
 Insertion of a key into a B-tree
 Deletion from a B-tree
Oxford University Press © 2012Data Structures Using C++ by Dr Varsha Patil
18
 B+ trees are internal data structures
 That is, the nodes contain whatever information is
associated with the key as well as the key values
Oxford University Press © 2012Data Structures Using C++ by Dr Varsha Patil
19
 The structure of a B+ tree can be understood from the
following points:
 A B+ tree is in the form of a balanced tree where every
path from the root of the tree to a leaf of the tree is of
the same length
 Each non-leaf node (internal node) in the tree has
between [n/2] and n children, where n is fixed
 The pointer (Ptr) can point to either a file record or a
bucket of pointers which each point to a file record
 Searching time is less in B+ trees but has some
problem of wasted space
Oxford University Press © 2012Data Structures Using C++ by Dr Varsha Patil
20
 Internal node of a B+ tree with q −1 search values
 Leaf node of a B+ tree with q − 1 search values and q − 1
data pointers
Oxford University Press © 2012Data Structures Using C++ by Dr Varsha Patil
21
Ptr1 Key1 Ptr2 Key2 Ptri Keyi …….. Keyn-1 Ptrn
X XX
X<Key1 Keyi-1<X<Keyi X>Keyn-1
Tree Pointer
Tree Pointer
Tree Pointer
Oxford University Press © 2012Data Structures Using C++ by Dr Varsha Patil
22
 A dynamic index structure that adjusts gracefully to
inserts and deletes
 A balanced tree
 Leaf pages are not allocated sequentially. They are
linked together through pointers (a doubly linked list)
Oxford University Press © 2012Data Structures Using C++ by Dr Varsha Patil
23
 One solution is to prune from the tree all the branches
that do not lead to any key
 The resulting tree is called a trie (short for reTRIEvaL and
pronounced ‘try’)
 The number of steps needed to search a trie is
proportional to the number of characters in a key
Oxford University Press © 2012Data Structures Using C++ by Dr Varsha Patil
24
 Splay trees are a form of a BST. A splay tree maintains a
balance without any explicit balance condition such as
color
 Instead, ‘splay operations’, which involve rotations, are
performed within the tree every time an access is made
Oxford University Press © 2012Data Structures Using C++ by Dr Varsha Patil
25
 If we use a BST or even an AVL tree, then the records of the newly
admitted patient’s records will go to a leaf position, far from the
root, and the access will be slower
 Instead, we want to keep the records that are newly inserted or
frequently accessed very near to the root, while the inactive
records far off, in the leaf positions
 However, we do not want to rebuild the tree into the desired
shape. Instead, we need to make a tree a self-adjusting data
structure that automatically changes its shape to bring the
records closer to the root as they are used frequently, allowing
inactive records to drift slowly down towards the leaves. Such
trees are called as splay trees
Oxford University Press © 2012Data Structures Using C++ by Dr Varsha Patil
26
 A red-black tree is a BST with one extra bit of storage per
node: its colour, which can either be red or black
Oxford University Press © 2012Data Structures Using C++ by Dr Varsha Patil
27
 Every node is either red or black
 All the external nodes (leaf nodes) are black
 The rank in a tree goes from zero upto the maximum rank which
occurs at the root. The rank of two consecutive nodes differs by
utmost 1. Each leaf node has a rank 0
 If a node is red, then both its children are black. In other words,
consecutive red nodes are disallowed. This means every red
node is followed by a black node; on the other hand, a black
node may be followed by a black or a red node
 This implies that utmost 50% of the nodes on any path from
external node to root are red
Oxford University Press © 2012Data Structures Using C++ by Dr Varsha Patil
28
 The number of black nodes on any path from but not
including the node x to leaf is called as black height of the
node x, denoted as bh(x)
 Every simple path from the root to a leaf contains the
same number of black nodes
 In addition, every simple path from a node to a
descendent leaf contains the same number of black nodes
 If a black node has a rank r, then its parent has the rank r
+ 1
 If a red node has a rank r, then its parent will have the
rank r as well
Oxford University Press © 2012Data Structures Using C++ by Dr Varsha Patil
29
 A KD-tree is a data structure used in computer science
during orthogonal range searching, for instance, to find
the set of points that fall into a given rectangle
Oxford University Press © 2012Data Structures Using C++ by Dr Varsha Patil
30
An AA tree is a balanced BST with the following properties:
 Every node is colored either red or black
 The root is black
 If a node is red, both of its children are black
 Every path from a node to a null reference has the same
number of black nodes
 Left children may not be red
Oxford University Press © 2012Data Structures Using C++ by Dr Varsha Patil
31
 They eliminate half the reconstructing cases
 They simplify deletion by removing an annoying case
 If an internal node has only one child, that child must be a
red child
 We can always replace a node with the smallest child in the
right subtree; it will either be a leaf node or have a red child
 AA tree, balanced BST, supports efficient operations, since
most operations only have to traverse one or two root-to-
leaf paths
Oxford University Press © 2012Data Structures Using C++ by Dr Varsha Patil
32
 In each node of AA tree, we store a level. The level is
defined by the following rules:
 If a node is a leaf, its level is one
 If a node is red, its level is the level of its parent
 If a node is black, its level is one less than the level of
its parent
 Here, the level is the number of left links to a null
reference
Oxford University Press © 2012Data Structures Using C++ by Dr Varsha Patil
33
 A horizontal link is a connection between a node and a
child with equal levels
 The properties of such horizontal links are as follows:
 Horizontal links are right references
 There cannot be two consecutives horizontal links
 Nodes at level two or higher must have two children
 If a node has no right horizontal link, its two children
are at the same level
Oxford University Press © 2012Data Structures Using C++ by Dr Varsha Patil
34

 A node of a BST has only one key value entry stored in it. A multiway
tree has many key values stored in each node and thus each node
may have multiple subtrees
 Different indexing techniques are used to search a record in O(1)
time. The index is a pair of key value and address. It is an indirect
addressing that imposes order on a file without rearranging the file
 Indexing techniques are classified as Hashed indexing, Tree
indexing, B-tree, B+ tree, Trie tree
 Splay trees are self-adjusting trees
Oxford University Press © 2012Data Structures Using C++ by Dr Varsha Patil
35

More Related Content

What's hot

Linked list
Linked list Linked list
Linked list
Arbind Mandal
 
14. Files - Data Structures using C++ by Varsha Patil
14. Files - Data Structures using C++ by Varsha Patil14. Files - Data Structures using C++ by Varsha Patil
14. Files - Data Structures using C++ by Varsha Patil
widespreadpromotion
 
Trees, Binary Search Tree, AVL Tree in Data Structures
Trees, Binary Search Tree, AVL Tree in Data Structures Trees, Binary Search Tree, AVL Tree in Data Structures
Trees, Binary Search Tree, AVL Tree in Data Structures
Gurukul Kangri Vishwavidyalaya - Faculty of Engineering and Technology
 
Binary Search Tree
Binary Search TreeBinary Search Tree
Binary Search Tree
Zafar Ayub
 
Data Structure and Algorithms Binary Search Tree
Data Structure and Algorithms Binary Search TreeData Structure and Algorithms Binary Search Tree
Data Structure and Algorithms Binary Search Tree
ManishPrajapati78
 
Quick sort
Quick sortQuick sort
Quick sort
Dhruv Sabalpara
 
07. disjoint set
07. disjoint set07. disjoint set
07. disjoint set
Onkar Nath Sharma
 
Red black tree
Red black treeRed black tree
Red black tree
Rajendran
 
Stack and queue
Stack and queueStack and queue
Stack and queue
CHANDAN KUMAR
 
Doubly Linked List
Doubly Linked ListDoubly Linked List
Tree in data structure
Tree in data structureTree in data structure
Tree in data structure
ghhgj jhgh
 
Analysis Of Algorithms - Hashing
Analysis Of Algorithms - HashingAnalysis Of Algorithms - Hashing
Analysis Of Algorithms - Hashing
Sam Light
 
ADA - Minimum Spanning Tree Prim Kruskal and Dijkstra
ADA - Minimum Spanning Tree Prim Kruskal and Dijkstra ADA - Minimum Spanning Tree Prim Kruskal and Dijkstra
ADA - Minimum Spanning Tree Prim Kruskal and Dijkstra
Sahil Kumar
 
8. Graph - Data Structures using C++ by Varsha Patil
8. Graph - Data Structures using C++ by Varsha Patil8. Graph - Data Structures using C++ by Varsha Patil
8. Graph - Data Structures using C++ by Varsha Patil
widespreadpromotion
 
Hashing PPT
Hashing PPTHashing PPT
Hashing PPT
Saurabh Kumar
 
Different Sorting tecniques in Data Structure
Different Sorting tecniques in Data StructureDifferent Sorting tecniques in Data Structure
Different Sorting tecniques in Data Structure
Tushar Gonawala
 
Tree in data structure
Tree in data structureTree in data structure
Tree in data structure
Äshïsh Jäïn
 
Lecture notes data structures tree
Lecture notes data structures   treeLecture notes data structures   tree
Lecture notes data structures tree
maamir farooq
 
non linear data structure -introduction of tree
non linear data structure -introduction of treenon linear data structure -introduction of tree
non linear data structure -introduction of tree
Siddhi Viradiya
 
12. Indexing and Hashing in DBMS
12. Indexing and Hashing in DBMS12. Indexing and Hashing in DBMS
12. Indexing and Hashing in DBMS
koolkampus
 

What's hot (20)

Linked list
Linked list Linked list
Linked list
 
14. Files - Data Structures using C++ by Varsha Patil
14. Files - Data Structures using C++ by Varsha Patil14. Files - Data Structures using C++ by Varsha Patil
14. Files - Data Structures using C++ by Varsha Patil
 
Trees, Binary Search Tree, AVL Tree in Data Structures
Trees, Binary Search Tree, AVL Tree in Data Structures Trees, Binary Search Tree, AVL Tree in Data Structures
Trees, Binary Search Tree, AVL Tree in Data Structures
 
Binary Search Tree
Binary Search TreeBinary Search Tree
Binary Search Tree
 
Data Structure and Algorithms Binary Search Tree
Data Structure and Algorithms Binary Search TreeData Structure and Algorithms Binary Search Tree
Data Structure and Algorithms Binary Search Tree
 
Quick sort
Quick sortQuick sort
Quick sort
 
07. disjoint set
07. disjoint set07. disjoint set
07. disjoint set
 
Red black tree
Red black treeRed black tree
Red black tree
 
Stack and queue
Stack and queueStack and queue
Stack and queue
 
Doubly Linked List
Doubly Linked ListDoubly Linked List
Doubly Linked List
 
Tree in data structure
Tree in data structureTree in data structure
Tree in data structure
 
Analysis Of Algorithms - Hashing
Analysis Of Algorithms - HashingAnalysis Of Algorithms - Hashing
Analysis Of Algorithms - Hashing
 
ADA - Minimum Spanning Tree Prim Kruskal and Dijkstra
ADA - Minimum Spanning Tree Prim Kruskal and Dijkstra ADA - Minimum Spanning Tree Prim Kruskal and Dijkstra
ADA - Minimum Spanning Tree Prim Kruskal and Dijkstra
 
8. Graph - Data Structures using C++ by Varsha Patil
8. Graph - Data Structures using C++ by Varsha Patil8. Graph - Data Structures using C++ by Varsha Patil
8. Graph - Data Structures using C++ by Varsha Patil
 
Hashing PPT
Hashing PPTHashing PPT
Hashing PPT
 
Different Sorting tecniques in Data Structure
Different Sorting tecniques in Data StructureDifferent Sorting tecniques in Data Structure
Different Sorting tecniques in Data Structure
 
Tree in data structure
Tree in data structureTree in data structure
Tree in data structure
 
Lecture notes data structures tree
Lecture notes data structures   treeLecture notes data structures   tree
Lecture notes data structures tree
 
non linear data structure -introduction of tree
non linear data structure -introduction of treenon linear data structure -introduction of tree
non linear data structure -introduction of tree
 
12. Indexing and Hashing in DBMS
12. Indexing and Hashing in DBMS12. Indexing and Hashing in DBMS
12. Indexing and Hashing in DBMS
 

Viewers also liked

12. Heaps - Data Structures using C++ by Varsha Patil
12. Heaps - Data Structures using C++ by Varsha Patil12. Heaps - Data Structures using C++ by Varsha Patil
12. Heaps - Data Structures using C++ by Varsha Patil
widespreadpromotion
 
Discrete Mathematics S. Lipschutz, M. Lipson And V. H. Patil
Discrete Mathematics S. Lipschutz, M. Lipson And V. H. PatilDiscrete Mathematics S. Lipschutz, M. Lipson And V. H. Patil
Discrete Mathematics S. Lipschutz, M. Lipson And V. H. Patil
widespreadpromotion
 
16. Algo analysis & Design - Data Structures using C++ by Varsha Patil
16. Algo analysis & Design - Data Structures using C++ by Varsha Patil16. Algo analysis & Design - Data Structures using C++ by Varsha Patil
16. Algo analysis & Design - Data Structures using C++ by Varsha Patil
widespreadpromotion
 
15. STL - Data Structures using C++ by Varsha Patil
15. STL - Data Structures using C++ by Varsha Patil15. STL - Data Structures using C++ by Varsha Patil
15. STL - Data Structures using C++ by Varsha Patil
widespreadpromotion
 
4. Recursion - Data Structures using C++ by Varsha Patil
4. Recursion - Data Structures using C++ by Varsha Patil4. Recursion - Data Structures using C++ by Varsha Patil
4. Recursion - Data Structures using C++ by Varsha Patil
widespreadpromotion
 
Pointers in c++
Pointers in c++Pointers in c++
Pointers in c++
Vineeta Garg
 
9. Searching & Sorting - Data Structures using C++ by Varsha Patil
9. Searching & Sorting - Data Structures using C++ by Varsha Patil9. Searching & Sorting - Data Structures using C++ by Varsha Patil
9. Searching & Sorting - Data Structures using C++ by Varsha Patil
widespreadpromotion
 
Lists, queues and stacks
Lists, queues and stacksLists, queues and stacks
Lists, queues and stacks
andreeamolnar
 
Array,lists and hashes in perl
Array,lists and hashes in perlArray,lists and hashes in perl
Array,lists and hashes in perl
sana mateen
 
Constructors and destructors
Constructors and destructorsConstructors and destructors
Constructors and destructors
Vineeta Garg
 
Advanced data structures using c++ 3
Advanced data structures using c++ 3Advanced data structures using c++ 3
Advanced data structures using c++ 3
Shaili Choudhary
 
Classes and objects1
Classes and objects1Classes and objects1
Classes and objects1
Vineeta Garg
 
Structured query language functions
Structured query language functionsStructured query language functions
Structured query language functions
Vineeta Garg
 
Structured query language constraints
Structured query language constraintsStructured query language constraints
Structured query language constraints
Vineeta Garg
 
Pp
PpPp
Stacks in c++
Stacks in c++Stacks in c++
Stacks in c++
Vineeta Garg
 
Working with Cookies in NodeJS
Working with Cookies in NodeJSWorking with Cookies in NodeJS
Working with Cookies in NodeJS
Jay Dihenkar
 
Data types in c++
Data types in c++Data types in c++
Data types in c++
Venkata.Manish Reddy
 
C++ data types
C++ data typesC++ data types
C++ data types
pratikborsadiya
 
Data Structure
Data StructureData Structure
Data Structure
sheraz1
 

Viewers also liked (20)

12. Heaps - Data Structures using C++ by Varsha Patil
12. Heaps - Data Structures using C++ by Varsha Patil12. Heaps - Data Structures using C++ by Varsha Patil
12. Heaps - Data Structures using C++ by Varsha Patil
 
Discrete Mathematics S. Lipschutz, M. Lipson And V. H. Patil
Discrete Mathematics S. Lipschutz, M. Lipson And V. H. PatilDiscrete Mathematics S. Lipschutz, M. Lipson And V. H. Patil
Discrete Mathematics S. Lipschutz, M. Lipson And V. H. Patil
 
16. Algo analysis & Design - Data Structures using C++ by Varsha Patil
16. Algo analysis & Design - Data Structures using C++ by Varsha Patil16. Algo analysis & Design - Data Structures using C++ by Varsha Patil
16. Algo analysis & Design - Data Structures using C++ by Varsha Patil
 
15. STL - Data Structures using C++ by Varsha Patil
15. STL - Data Structures using C++ by Varsha Patil15. STL - Data Structures using C++ by Varsha Patil
15. STL - Data Structures using C++ by Varsha Patil
 
4. Recursion - Data Structures using C++ by Varsha Patil
4. Recursion - Data Structures using C++ by Varsha Patil4. Recursion - Data Structures using C++ by Varsha Patil
4. Recursion - Data Structures using C++ by Varsha Patil
 
Pointers in c++
Pointers in c++Pointers in c++
Pointers in c++
 
9. Searching & Sorting - Data Structures using C++ by Varsha Patil
9. Searching & Sorting - Data Structures using C++ by Varsha Patil9. Searching & Sorting - Data Structures using C++ by Varsha Patil
9. Searching & Sorting - Data Structures using C++ by Varsha Patil
 
Lists, queues and stacks
Lists, queues and stacksLists, queues and stacks
Lists, queues and stacks
 
Array,lists and hashes in perl
Array,lists and hashes in perlArray,lists and hashes in perl
Array,lists and hashes in perl
 
Constructors and destructors
Constructors and destructorsConstructors and destructors
Constructors and destructors
 
Advanced data structures using c++ 3
Advanced data structures using c++ 3Advanced data structures using c++ 3
Advanced data structures using c++ 3
 
Classes and objects1
Classes and objects1Classes and objects1
Classes and objects1
 
Structured query language functions
Structured query language functionsStructured query language functions
Structured query language functions
 
Structured query language constraints
Structured query language constraintsStructured query language constraints
Structured query language constraints
 
Pp
PpPp
Pp
 
Stacks in c++
Stacks in c++Stacks in c++
Stacks in c++
 
Working with Cookies in NodeJS
Working with Cookies in NodeJSWorking with Cookies in NodeJS
Working with Cookies in NodeJS
 
Data types in c++
Data types in c++Data types in c++
Data types in c++
 
C++ data types
C++ data typesC++ data types
C++ data types
 
Data Structure
Data StructureData Structure
Data Structure
 

Similar to 13. Indexing MTrees - Data Structures using C++ by Varsha Patil

7. Tree - Data Structures using C++ by Varsha Patil
7. Tree - Data Structures using C++ by Varsha Patil7. Tree - Data Structures using C++ by Varsha Patil
7. Tree - Data Structures using C++ by Varsha Patil
widespreadpromotion
 
6. Linked list - Data Structures using C++ by Varsha Patil
6. Linked list - Data Structures using C++ by Varsha Patil6. Linked list - Data Structures using C++ by Varsha Patil
6. Linked list - Data Structures using C++ by Varsha Patil
widespreadpromotion
 
Data Structures
Data StructuresData Structures
Data Structures
Prof. Dr. K. Adisesha
 
Chapter 8: tree data structure
Chapter 8:  tree data structureChapter 8:  tree data structure
Chapter 8: tree data structure
Mahmoud Alfarra
 
17. Trees and Tree Like Structures
17. Trees and Tree Like Structures17. Trees and Tree Like Structures
17. Trees and Tree Like Structures
Intro C# Book
 
A41001011
A41001011A41001011
A41001011
ijceronline
 
3. Stack - Data Structures using C++ by Varsha Patil
3. Stack - Data Structures using C++ by Varsha Patil3. Stack - Data Structures using C++ by Varsha Patil
3. Stack - Data Structures using C++ by Varsha Patil
widespreadpromotion
 
datastructure-201021140600.pptx
datastructure-201021140600.pptxdatastructure-201021140600.pptx
datastructure-201021140600.pptx
ZISAN5
 
104333 sri vidhya eng notes
104333 sri vidhya eng notes104333 sri vidhya eng notes
104333 sri vidhya eng notes
Krishnakumar Btech
 
Ch12
Ch12Ch12
SIX WEEKS SUMMER TRAINING REPORT.pptx
SIX WEEKS SUMMER TRAINING REPORT.pptxSIX WEEKS SUMMER TRAINING REPORT.pptx
SIX WEEKS SUMMER TRAINING REPORT.pptx
sagabo1
 
Indexing and Hashing.ppt
Indexing and Hashing.pptIndexing and Hashing.ppt
Indexing and Hashing.ppt
vedantihp21
 
Indexing and hashing
Indexing and hashingIndexing and hashing
Indexing and hashing
Jeet Poria
 
DATA STUCTURES-TREES.pptx
DATA STUCTURES-TREES.pptxDATA STUCTURES-TREES.pptx
DATA STUCTURES-TREES.pptx
AryaMNair6
 
Indexing structure for files
Indexing structure for filesIndexing structure for files
Indexing structure for files
Zainab Almugbel
 
indexingstructureforfiles-160728120658.pdf
indexingstructureforfiles-160728120658.pdfindexingstructureforfiles-160728120658.pdf
indexingstructureforfiles-160728120658.pdf
FraolUmeta
 
ch12
ch12ch12
Dynamic multi level indexing Using B-Trees And B+ Trees
Dynamic multi level indexing Using B-Trees And B+ TreesDynamic multi level indexing Using B-Trees And B+ Trees
Dynamic multi level indexing Using B-Trees And B+ Trees
Pooja Dixit
 
Tree Data Structure Tree Data Structure Details
Tree Data Structure Tree Data Structure DetailsTree Data Structure Tree Data Structure Details
Tree Data Structure Tree Data Structure Details
ssusera8c91a
 
Data structure tree - beginner
Data structure tree - beginnerData structure tree - beginner
Data structure tree - beginner
MD. MARUFUZZAMAN .
 

Similar to 13. Indexing MTrees - Data Structures using C++ by Varsha Patil (20)

7. Tree - Data Structures using C++ by Varsha Patil
7. Tree - Data Structures using C++ by Varsha Patil7. Tree - Data Structures using C++ by Varsha Patil
7. Tree - Data Structures using C++ by Varsha Patil
 
6. Linked list - Data Structures using C++ by Varsha Patil
6. Linked list - Data Structures using C++ by Varsha Patil6. Linked list - Data Structures using C++ by Varsha Patil
6. Linked list - Data Structures using C++ by Varsha Patil
 
Data Structures
Data StructuresData Structures
Data Structures
 
Chapter 8: tree data structure
Chapter 8:  tree data structureChapter 8:  tree data structure
Chapter 8: tree data structure
 
17. Trees and Tree Like Structures
17. Trees and Tree Like Structures17. Trees and Tree Like Structures
17. Trees and Tree Like Structures
 
A41001011
A41001011A41001011
A41001011
 
3. Stack - Data Structures using C++ by Varsha Patil
3. Stack - Data Structures using C++ by Varsha Patil3. Stack - Data Structures using C++ by Varsha Patil
3. Stack - Data Structures using C++ by Varsha Patil
 
datastructure-201021140600.pptx
datastructure-201021140600.pptxdatastructure-201021140600.pptx
datastructure-201021140600.pptx
 
104333 sri vidhya eng notes
104333 sri vidhya eng notes104333 sri vidhya eng notes
104333 sri vidhya eng notes
 
Ch12
Ch12Ch12
Ch12
 
SIX WEEKS SUMMER TRAINING REPORT.pptx
SIX WEEKS SUMMER TRAINING REPORT.pptxSIX WEEKS SUMMER TRAINING REPORT.pptx
SIX WEEKS SUMMER TRAINING REPORT.pptx
 
Indexing and Hashing.ppt
Indexing and Hashing.pptIndexing and Hashing.ppt
Indexing and Hashing.ppt
 
Indexing and hashing
Indexing and hashingIndexing and hashing
Indexing and hashing
 
DATA STUCTURES-TREES.pptx
DATA STUCTURES-TREES.pptxDATA STUCTURES-TREES.pptx
DATA STUCTURES-TREES.pptx
 
Indexing structure for files
Indexing structure for filesIndexing structure for files
Indexing structure for files
 
indexingstructureforfiles-160728120658.pdf
indexingstructureforfiles-160728120658.pdfindexingstructureforfiles-160728120658.pdf
indexingstructureforfiles-160728120658.pdf
 
ch12
ch12ch12
ch12
 
Dynamic multi level indexing Using B-Trees And B+ Trees
Dynamic multi level indexing Using B-Trees And B+ TreesDynamic multi level indexing Using B-Trees And B+ Trees
Dynamic multi level indexing Using B-Trees And B+ Trees
 
Tree Data Structure Tree Data Structure Details
Tree Data Structure Tree Data Structure DetailsTree Data Structure Tree Data Structure Details
Tree Data Structure Tree Data Structure Details
 
Data structure tree - beginner
Data structure tree - beginnerData structure tree - beginner
Data structure tree - beginner
 

Recently uploaded

University of New South Wales degree offer diploma Transcript
University of New South Wales degree offer diploma TranscriptUniversity of New South Wales degree offer diploma Transcript
University of New South Wales degree offer diploma Transcript
soxrziqu
 
My burning issue is homelessness K.C.M.O.
My burning issue is homelessness K.C.M.O.My burning issue is homelessness K.C.M.O.
My burning issue is homelessness K.C.M.O.
rwarrenll
 
一比一原版(Chester毕业证书)切斯特大学毕业证如何办理
一比一原版(Chester毕业证书)切斯特大学毕业证如何办理一比一原版(Chester毕业证书)切斯特大学毕业证如何办理
一比一原版(Chester毕业证书)切斯特大学毕业证如何办理
74nqk8xf
 
Population Growth in Bataan: The effects of population growth around rural pl...
Population Growth in Bataan: The effects of population growth around rural pl...Population Growth in Bataan: The effects of population growth around rural pl...
Population Growth in Bataan: The effects of population growth around rural pl...
Bill641377
 
一比一原版(UMN文凭证书)明尼苏达大学毕业证如何办理
一比一原版(UMN文凭证书)明尼苏达大学毕业证如何办理一比一原版(UMN文凭证书)明尼苏达大学毕业证如何办理
一比一原版(UMN文凭证书)明尼苏达大学毕业证如何办理
nyfuhyz
 
End-to-end pipeline agility - Berlin Buzzwords 2024
End-to-end pipeline agility - Berlin Buzzwords 2024End-to-end pipeline agility - Berlin Buzzwords 2024
End-to-end pipeline agility - Berlin Buzzwords 2024
Lars Albertsson
 
Influence of Marketing Strategy and Market Competition on Business Plan
Influence of Marketing Strategy and Market Competition on Business PlanInfluence of Marketing Strategy and Market Competition on Business Plan
Influence of Marketing Strategy and Market Competition on Business Plan
jerlynmaetalle
 
Everything you wanted to know about LIHTC
Everything you wanted to know about LIHTCEverything you wanted to know about LIHTC
Everything you wanted to know about LIHTC
Roger Valdez
 
一比一原版(牛布毕业证书)牛津布鲁克斯大学毕业证如何办理
一比一原版(牛布毕业证书)牛津布鲁克斯大学毕业证如何办理一比一原版(牛布毕业证书)牛津布鲁克斯大学毕业证如何办理
一比一原版(牛布毕业证书)牛津布鲁克斯大学毕业证如何办理
74nqk8xf
 
Analysis insight about a Flyball dog competition team's performance
Analysis insight about a Flyball dog competition team's performanceAnalysis insight about a Flyball dog competition team's performance
Analysis insight about a Flyball dog competition team's performance
roli9797
 
06-04-2024 - NYC Tech Week - Discussion on Vector Databases, Unstructured Dat...
06-04-2024 - NYC Tech Week - Discussion on Vector Databases, Unstructured Dat...06-04-2024 - NYC Tech Week - Discussion on Vector Databases, Unstructured Dat...
06-04-2024 - NYC Tech Week - Discussion on Vector Databases, Unstructured Dat...
Timothy Spann
 
Beyond the Basics of A/B Tests: Highly Innovative Experimentation Tactics You...
Beyond the Basics of A/B Tests: Highly Innovative Experimentation Tactics You...Beyond the Basics of A/B Tests: Highly Innovative Experimentation Tactics You...
Beyond the Basics of A/B Tests: Highly Innovative Experimentation Tactics You...
Aggregage
 
Challenges of Nation Building-1.pptx with more important
Challenges of Nation Building-1.pptx with more importantChallenges of Nation Building-1.pptx with more important
Challenges of Nation Building-1.pptx with more important
Sm321
 
Palo Alto Cortex XDR presentation .......
Palo Alto Cortex XDR presentation .......Palo Alto Cortex XDR presentation .......
Palo Alto Cortex XDR presentation .......
Sachin Paul
 
一比一原版(UCSF文凭证书)旧金山分校毕业证如何办理
一比一原版(UCSF文凭证书)旧金山分校毕业证如何办理一比一原版(UCSF文凭证书)旧金山分校毕业证如何办理
一比一原版(UCSF文凭证书)旧金山分校毕业证如何办理
nuttdpt
 
06-04-2024 - NYC Tech Week - Discussion on Vector Databases, Unstructured Dat...
06-04-2024 - NYC Tech Week - Discussion on Vector Databases, Unstructured Dat...06-04-2024 - NYC Tech Week - Discussion on Vector Databases, Unstructured Dat...
06-04-2024 - NYC Tech Week - Discussion on Vector Databases, Unstructured Dat...
Timothy Spann
 
Learn SQL from basic queries to Advance queries
Learn SQL from basic queries to Advance queriesLearn SQL from basic queries to Advance queries
Learn SQL from basic queries to Advance queries
manishkhaire30
 
一比一原版(Coventry毕业证书)考文垂大学毕业证如何办理
一比一原版(Coventry毕业证书)考文垂大学毕业证如何办理一比一原版(Coventry毕业证书)考文垂大学毕业证如何办理
一比一原版(Coventry毕业证书)考文垂大学毕业证如何办理
74nqk8xf
 
一比一原版(Harvard毕业证书)哈佛大学毕业证如何办理
一比一原版(Harvard毕业证书)哈佛大学毕业证如何办理一比一原版(Harvard毕业证书)哈佛大学毕业证如何办理
一比一原版(Harvard毕业证书)哈佛大学毕业证如何办理
zsjl4mimo
 
一比一原版(UCSB文凭证书)圣芭芭拉分校毕业证如何办理
一比一原版(UCSB文凭证书)圣芭芭拉分校毕业证如何办理一比一原版(UCSB文凭证书)圣芭芭拉分校毕业证如何办理
一比一原版(UCSB文凭证书)圣芭芭拉分校毕业证如何办理
nuttdpt
 

Recently uploaded (20)

University of New South Wales degree offer diploma Transcript
University of New South Wales degree offer diploma TranscriptUniversity of New South Wales degree offer diploma Transcript
University of New South Wales degree offer diploma Transcript
 
My burning issue is homelessness K.C.M.O.
My burning issue is homelessness K.C.M.O.My burning issue is homelessness K.C.M.O.
My burning issue is homelessness K.C.M.O.
 
一比一原版(Chester毕业证书)切斯特大学毕业证如何办理
一比一原版(Chester毕业证书)切斯特大学毕业证如何办理一比一原版(Chester毕业证书)切斯特大学毕业证如何办理
一比一原版(Chester毕业证书)切斯特大学毕业证如何办理
 
Population Growth in Bataan: The effects of population growth around rural pl...
Population Growth in Bataan: The effects of population growth around rural pl...Population Growth in Bataan: The effects of population growth around rural pl...
Population Growth in Bataan: The effects of population growth around rural pl...
 
一比一原版(UMN文凭证书)明尼苏达大学毕业证如何办理
一比一原版(UMN文凭证书)明尼苏达大学毕业证如何办理一比一原版(UMN文凭证书)明尼苏达大学毕业证如何办理
一比一原版(UMN文凭证书)明尼苏达大学毕业证如何办理
 
End-to-end pipeline agility - Berlin Buzzwords 2024
End-to-end pipeline agility - Berlin Buzzwords 2024End-to-end pipeline agility - Berlin Buzzwords 2024
End-to-end pipeline agility - Berlin Buzzwords 2024
 
Influence of Marketing Strategy and Market Competition on Business Plan
Influence of Marketing Strategy and Market Competition on Business PlanInfluence of Marketing Strategy and Market Competition on Business Plan
Influence of Marketing Strategy and Market Competition on Business Plan
 
Everything you wanted to know about LIHTC
Everything you wanted to know about LIHTCEverything you wanted to know about LIHTC
Everything you wanted to know about LIHTC
 
一比一原版(牛布毕业证书)牛津布鲁克斯大学毕业证如何办理
一比一原版(牛布毕业证书)牛津布鲁克斯大学毕业证如何办理一比一原版(牛布毕业证书)牛津布鲁克斯大学毕业证如何办理
一比一原版(牛布毕业证书)牛津布鲁克斯大学毕业证如何办理
 
Analysis insight about a Flyball dog competition team's performance
Analysis insight about a Flyball dog competition team's performanceAnalysis insight about a Flyball dog competition team's performance
Analysis insight about a Flyball dog competition team's performance
 
06-04-2024 - NYC Tech Week - Discussion on Vector Databases, Unstructured Dat...
06-04-2024 - NYC Tech Week - Discussion on Vector Databases, Unstructured Dat...06-04-2024 - NYC Tech Week - Discussion on Vector Databases, Unstructured Dat...
06-04-2024 - NYC Tech Week - Discussion on Vector Databases, Unstructured Dat...
 
Beyond the Basics of A/B Tests: Highly Innovative Experimentation Tactics You...
Beyond the Basics of A/B Tests: Highly Innovative Experimentation Tactics You...Beyond the Basics of A/B Tests: Highly Innovative Experimentation Tactics You...
Beyond the Basics of A/B Tests: Highly Innovative Experimentation Tactics You...
 
Challenges of Nation Building-1.pptx with more important
Challenges of Nation Building-1.pptx with more importantChallenges of Nation Building-1.pptx with more important
Challenges of Nation Building-1.pptx with more important
 
Palo Alto Cortex XDR presentation .......
Palo Alto Cortex XDR presentation .......Palo Alto Cortex XDR presentation .......
Palo Alto Cortex XDR presentation .......
 
一比一原版(UCSF文凭证书)旧金山分校毕业证如何办理
一比一原版(UCSF文凭证书)旧金山分校毕业证如何办理一比一原版(UCSF文凭证书)旧金山分校毕业证如何办理
一比一原版(UCSF文凭证书)旧金山分校毕业证如何办理
 
06-04-2024 - NYC Tech Week - Discussion on Vector Databases, Unstructured Dat...
06-04-2024 - NYC Tech Week - Discussion on Vector Databases, Unstructured Dat...06-04-2024 - NYC Tech Week - Discussion on Vector Databases, Unstructured Dat...
06-04-2024 - NYC Tech Week - Discussion on Vector Databases, Unstructured Dat...
 
Learn SQL from basic queries to Advance queries
Learn SQL from basic queries to Advance queriesLearn SQL from basic queries to Advance queries
Learn SQL from basic queries to Advance queries
 
一比一原版(Coventry毕业证书)考文垂大学毕业证如何办理
一比一原版(Coventry毕业证书)考文垂大学毕业证如何办理一比一原版(Coventry毕业证书)考文垂大学毕业证如何办理
一比一原版(Coventry毕业证书)考文垂大学毕业证如何办理
 
一比一原版(Harvard毕业证书)哈佛大学毕业证如何办理
一比一原版(Harvard毕业证书)哈佛大学毕业证如何办理一比一原版(Harvard毕业证书)哈佛大学毕业证如何办理
一比一原版(Harvard毕业证书)哈佛大学毕业证如何办理
 
一比一原版(UCSB文凭证书)圣芭芭拉分校毕业证如何办理
一比一原版(UCSB文凭证书)圣芭芭拉分校毕业证如何办理一比一原版(UCSB文凭证书)圣芭芭拉分校毕业证如何办理
一比一原版(UCSB文凭证书)圣芭芭拉分校毕业证如何办理
 

13. Indexing MTrees - Data Structures using C++ by Varsha Patil

  • 1. Oxford University Press © 2012Data Structures Using C++ by Dr Varsha Patil 1
  • 2. Oxford University Press © 2012Data Structures Using C++ by Dr Varsha Patil 2  Indexing techniques  B-trees which prove invaluable for problems of external information retrieval  A class of trees called tries, which share some properties of table lookup  Important uses of trees in many search techniques
  • 3. Oxford University Press © 2012Data Structures Using C++ by Dr Varsha Patil 3  A file is a collection of records, each record having one or more fields  The fields used to distinguish among the records are known as keys  File organization describes the way where the records are stored in a file  File organization is concerned with representing data records on an external storage media
  • 4. Oxford University Press © 2012Data Structures Using C++ by Dr Varsha Patil 4  The file organization breaks down into two more aspects:  Directory—for collection of indices  File organization—for the physical organization of records
  • 5. Oxford University Press © 2012Data Structures Using C++ by Dr Varsha Patil 5  File organization is the way records are organized on a physical storage  One of such organizations is sequential (ordered and unordered)  In this general framework, processing a query or updating a request would proceed in two steps:  The indices would be interrogated to determine the parts of the physical file to be searched  These parts of the physical file will be searched
  • 6. Oxford University Press © 2012Data Structures Using C++ by Dr Varsha Patil 6  An index, whether it is a book or a data file index (in computer memory), is based on the basic concepts such as keys and reference fields  The index to a book provides a way to find a topic quickly
  • 7. Oxford University Press © 2012Data Structures Using C++ by Dr Varsha Patil 7  An index, whether it is a book or a data file index (in computer memory), is based on the basic concepts such as keys and reference fields  The index to a book provides a way to find a topic quickly
  • 8. Oxford University Press © 2012Data Structures Using C++ by Dr Varsha Patil 8  This is the simplest type of index organization. It is useful only for the primary key index of a sequentially ordered file  In a sequentially ordered file, the physical sequence of records is ordered by the key, called the primary key  The cylinder-surface index consists of a cylinder index and several surface indexes
  • 9. Oxford University Press © 2012Data Structures Using C++ by Dr Varsha Patil 9 For each cylinder, there is a surface index. If the disk has S usable surfaces, then each surface index has s entries. The total number of surface index entries is C.S Emp. No. Emp. Name Cylinder Surface 1 2 3 4 5 6 7 8 Abolee Anand Amit Amol Rohit Santosh Saurabh Shila 1 1 1 1 2 2 2 2 1 1 2 2 1 1 2 2
  • 10. Oxford University Press © 2012Data Structures Using C++ by Dr Varsha Patil 10 Let there be two surfaces and two records stored per track. The file is organized sequentially on the field ‘Emp. name’ The cylinder index is shown in following table Emp. No. Highest Key Value 1 2 Amol Shila
  • 11. Oxford University Press © 2012Data Structures Using C++ by Dr Varsha Patil 11  This method of maintaining a file and index is referred to as ISAM (indexed sequential access method)  It is the simplest file organization for single key files but not useful for multiple key files
  • 12. Oxford University Press © 2012Data Structures Using C++ by Dr Varsha Patil 12  The operations related to hashed indexes are the same as those for hash tables
  • 13. Oxford University Press © 2012Data Structures Using C++ by Dr Varsha Patil 13  A multiway search tree is a tree of order m, where each node has utmost m children  Fig. shows way search tree: d e p v w x y zrh j k lb c qia f g m n o s t u
  • 14. Oxford University Press © 2012Data Structures Using C++ by Dr Varsha Patil 14  A B-tree is a balanced M-way tree. A node of the tree contains many records or keys of records and pointers to children  To reduce disk access, the following points are applicable:  Height is kept minimum  All leaves are kept at the same level  All other than leaves must have at least minimum number of children
  • 15. Oxford University Press © 2012Data Structures Using C++ by Dr Varsha Patil 15  Definition:  A B-tree of order m is an m-way tree with the following properties:  The number of keys in each internal node is one less than the number of its non-empty children, and these keys partition the keys in the children in the fashion of the search tree  All leaves are on the same level  All internal nodes except the root have utmost m non-empty children and at least [m/2] non-empty children  The root is either a leaf node, or it has from two to m children  A leaf node contains no more than m − 1 keys
  • 16. Oxford University Press © 2012Data Structures Using C++ by Dr Varsha Patil 16 Ptr1 Key1 Ptr2 Key2 Ptri Keyi …….. Keyn-1 Ptrn X XX X<Key1 Keyi-1<X<Keyi X>Keyn-1
  • 17. Oxford University Press © 2012Data Structures Using C++ by Dr Varsha Patil 17  Search a node  Insertion of a key into a B-tree  Deletion from a B-tree
  • 18. Oxford University Press © 2012Data Structures Using C++ by Dr Varsha Patil 18  B+ trees are internal data structures  That is, the nodes contain whatever information is associated with the key as well as the key values
  • 19. Oxford University Press © 2012Data Structures Using C++ by Dr Varsha Patil 19  The structure of a B+ tree can be understood from the following points:  A B+ tree is in the form of a balanced tree where every path from the root of the tree to a leaf of the tree is of the same length  Each non-leaf node (internal node) in the tree has between [n/2] and n children, where n is fixed  The pointer (Ptr) can point to either a file record or a bucket of pointers which each point to a file record  Searching time is less in B+ trees but has some problem of wasted space
  • 20. Oxford University Press © 2012Data Structures Using C++ by Dr Varsha Patil 20  Internal node of a B+ tree with q −1 search values  Leaf node of a B+ tree with q − 1 search values and q − 1 data pointers
  • 21. Oxford University Press © 2012Data Structures Using C++ by Dr Varsha Patil 21 Ptr1 Key1 Ptr2 Key2 Ptri Keyi …….. Keyn-1 Ptrn X XX X<Key1 Keyi-1<X<Keyi X>Keyn-1 Tree Pointer Tree Pointer Tree Pointer
  • 22. Oxford University Press © 2012Data Structures Using C++ by Dr Varsha Patil 22  A dynamic index structure that adjusts gracefully to inserts and deletes  A balanced tree  Leaf pages are not allocated sequentially. They are linked together through pointers (a doubly linked list)
  • 23. Oxford University Press © 2012Data Structures Using C++ by Dr Varsha Patil 23  One solution is to prune from the tree all the branches that do not lead to any key  The resulting tree is called a trie (short for reTRIEvaL and pronounced ‘try’)  The number of steps needed to search a trie is proportional to the number of characters in a key
  • 24. Oxford University Press © 2012Data Structures Using C++ by Dr Varsha Patil 24  Splay trees are a form of a BST. A splay tree maintains a balance without any explicit balance condition such as color  Instead, ‘splay operations’, which involve rotations, are performed within the tree every time an access is made
  • 25. Oxford University Press © 2012Data Structures Using C++ by Dr Varsha Patil 25  If we use a BST or even an AVL tree, then the records of the newly admitted patient’s records will go to a leaf position, far from the root, and the access will be slower  Instead, we want to keep the records that are newly inserted or frequently accessed very near to the root, while the inactive records far off, in the leaf positions  However, we do not want to rebuild the tree into the desired shape. Instead, we need to make a tree a self-adjusting data structure that automatically changes its shape to bring the records closer to the root as they are used frequently, allowing inactive records to drift slowly down towards the leaves. Such trees are called as splay trees
  • 26. Oxford University Press © 2012Data Structures Using C++ by Dr Varsha Patil 26  A red-black tree is a BST with one extra bit of storage per node: its colour, which can either be red or black
  • 27. Oxford University Press © 2012Data Structures Using C++ by Dr Varsha Patil 27  Every node is either red or black  All the external nodes (leaf nodes) are black  The rank in a tree goes from zero upto the maximum rank which occurs at the root. The rank of two consecutive nodes differs by utmost 1. Each leaf node has a rank 0  If a node is red, then both its children are black. In other words, consecutive red nodes are disallowed. This means every red node is followed by a black node; on the other hand, a black node may be followed by a black or a red node  This implies that utmost 50% of the nodes on any path from external node to root are red
  • 28. Oxford University Press © 2012Data Structures Using C++ by Dr Varsha Patil 28  The number of black nodes on any path from but not including the node x to leaf is called as black height of the node x, denoted as bh(x)  Every simple path from the root to a leaf contains the same number of black nodes  In addition, every simple path from a node to a descendent leaf contains the same number of black nodes  If a black node has a rank r, then its parent has the rank r + 1  If a red node has a rank r, then its parent will have the rank r as well
  • 29. Oxford University Press © 2012Data Structures Using C++ by Dr Varsha Patil 29  A KD-tree is a data structure used in computer science during orthogonal range searching, for instance, to find the set of points that fall into a given rectangle
  • 30. Oxford University Press © 2012Data Structures Using C++ by Dr Varsha Patil 30 An AA tree is a balanced BST with the following properties:  Every node is colored either red or black  The root is black  If a node is red, both of its children are black  Every path from a node to a null reference has the same number of black nodes  Left children may not be red
  • 31. Oxford University Press © 2012Data Structures Using C++ by Dr Varsha Patil 31  They eliminate half the reconstructing cases  They simplify deletion by removing an annoying case  If an internal node has only one child, that child must be a red child  We can always replace a node with the smallest child in the right subtree; it will either be a leaf node or have a red child  AA tree, balanced BST, supports efficient operations, since most operations only have to traverse one or two root-to- leaf paths
  • 32. Oxford University Press © 2012Data Structures Using C++ by Dr Varsha Patil 32  In each node of AA tree, we store a level. The level is defined by the following rules:  If a node is a leaf, its level is one  If a node is red, its level is the level of its parent  If a node is black, its level is one less than the level of its parent  Here, the level is the number of left links to a null reference
  • 33. Oxford University Press © 2012Data Structures Using C++ by Dr Varsha Patil 33  A horizontal link is a connection between a node and a child with equal levels  The properties of such horizontal links are as follows:  Horizontal links are right references  There cannot be two consecutives horizontal links  Nodes at level two or higher must have two children  If a node has no right horizontal link, its two children are at the same level
  • 34. Oxford University Press © 2012Data Structures Using C++ by Dr Varsha Patil 34   A node of a BST has only one key value entry stored in it. A multiway tree has many key values stored in each node and thus each node may have multiple subtrees  Different indexing techniques are used to search a record in O(1) time. The index is a pair of key value and address. It is an indirect addressing that imposes order on a file without rearranging the file  Indexing techniques are classified as Hashed indexing, Tree indexing, B-tree, B+ tree, Trie tree  Splay trees are self-adjusting trees
  • 35. Oxford University Press © 2012Data Structures Using C++ by Dr Varsha Patil 35