The document discusses multilevel indexing using B-trees. B-trees allow searches, insertions, and deletions in O(Log n) time. A B-tree of order m is a balanced tree where each node contains m keys and m+1 pointers. The document provides examples of adding records to a B-tree, which may involve splitting nodes and moving keys up the tree to avoid overflow. Hashing is also mentioned as another method for implementing dictionaries or key-value mappings.
3. Dr. Hussien M.
Sharaf
3
When an Index gets very big, it can not
be stored in RAM.
It should be stored on file, hence another
level of index that can be loaded into
memory is required.
Hence we need multilevel of indexing.
4. Dr. Hussien M.
Sharaf
4
B-tree
Allows searches, insertions, and deletions in
O(Log n) .
The B-tree is a generalization of a binary search
tree.
A Btree of order m is where each node contains (m)
keys and (m+1) pointers for children.
It is a balanced tree.
Each node is a sorted index of keys.
6. Dr. Hussien M.
Sharaf
6
Adding Records to a B Tree
If global root still have empty slots then place the
new record in sorted position in the appropriate
root node.
7. Dr. Hussien M.
Sharaf
7
Adding Records to a B Tree
If current node is full then:
1. Split the leaf node.
2. Place median key in the parent node in sorted order.
3. Records with keys < middle key go to the left leaf
node.
4. Records with keys >= middle key go to the right leaf
node.
8. Dr. Hussien M.
Sharaf
8
Adding Records to a B Tree
If parent node is full then:
1. Split the parent node.
2. keys < middle key go to the left parent node.
3. key s >= middle key go to the right parent node.
4. The median key goes to the next (higher level)
index.
5. IF the next level index node is full, continue
splitting the index nodes.
25. A hash table is an effective data structure for
implementing dictionaries.
A dictionary is an abstract data type composed
of a collection of (key,value) pairs, such that
each possible key appears at most once in the
collection.
Dr. Hussien M. Sharaf 25
26. A hash table uses a hash function as an
algorithm to map identifying values, known
as keys (e.g., a person's name), to their
associated values (e.g., their telephone
number).
Dr. Hussien M. Sharaf 26
27. 1. Direct-Address tables.
2. Hash tables.
3. Hash functions.
4. Open addressing.
5. Perfect hashing.
Dr. Hussien M. Sharaf 27