You are on page 1of 50

Multiway Trees

< < >


M-Way search tree
Properties
B-Trees
B-tree is an M-way tree with additional properties.
B-tree insertion

When the leaf is full, overflow occurs during insertion


The leaf node is split into two
New entry is inserted into one of these nodes
Parent node is created
Median data is inserted into parent node
(order 5)
B-tree insertion
Split node B-tree order of 5
Building a B-tree of order 5
Building a B-tree of order 5
Exercise
Build a B-tree of order 5 with the given sequence

12, 22, 15, 80, 98, 75, 86, 64, 43, 46, 58, 21, 17, 20, 53, 31, 22, 44, 100
continued
continued
B-tree deletion
Deletion sometimes results in underflow – node with fewer than the
minimum number of entries
Delete only from a leaf node
If the data is in internal node, we need to find a replacement
B-tree deletion
(Delete key not found in the node)
continued
nter manipulation
B-tree deletion summary
Exercise
Delete 70, 160, 50, 65, 20, 120, 130 and 100 from the tree of order 5
B-tree ADT
2-3 tree
Simplified B-tree
B-tree of order 3
Each non root internal node has 2 or 3 subtrees
Root can have 0, 2 or 3 subtrees
Trie structure
Used to construct Spell Checker for vocabulary of words.

Consider the vocabulary from the set of alphabets

Each node in Trie has pointers corresponding to these letters.


The first pointer points to the word stored.

You might also like