ADVANCED DATA STRUCTURES
M-Way Trees | B-Trees | Generalized Lists
1. Introduction to Advanced Data Structures
Data structures are the foundation of efficient software systems. As data volume increases, simple
structures such as arrays, linked lists, stacks, and queues become insufficient for handling large-
scale storage and searching requirements.
Advanced data structures covered in this document:
1. B-Trees
2. M-Way Trees
3. Generalized Lists
These structures are widely used in:
• Database Management Systems (DBMS)
• File Systems & Operating Systems
• Search Engines & Compilers
• Artificial Intelligence
• Hierarchical Data Processing
2. M-Way Trees
2.1 Introduction
An M-Way Tree is a generalized form of a binary search tree where each node can contain more
than one key and can have multiple children.
Feature Binary Tree M-Way Tree
Max Children 2 M
Max Keys per Node 1 M-1
Order 2 M (defined)
2.2 Structure of M-Way Tree Node
Page 1
, Advanced Data Structures
If a node contains k keys, then it can have k+1 children. Example with M = 4:
Child 0 Key 1 (10) Child 1 Key 2 (20) Child 2 Key 3 (30) Child 3
< 10 10–20 20–30 > 30
2.3 Properties of M-Way Trees
4. Maximum children per node: M
5. Maximum keys per node: M − 1
6. Keys inside a node are always stored in sorted order
7. If a node has k keys, it has k+1 children
8. Keys divide the search ranges for child nodes
2.4 Searching in M-Way Tree
Searching begins from the root node:
9. Compare the target key with keys inside the node
10. If key is found → search successful
11. Otherwise, move to the appropriate child node
12. Repeat until key is found or NULL is reached
Example: Node contains [15, 30, 50], Search key = 35
• 35 > 15, 35 > 30, 35 < 50 → Move to child between 30 and 50
2.5 Advantages & Disadvantages
Advantages Disadvantages
Faster searching vs binary trees Complex insertion and deletion
Smaller tree height More memory required
Better disk access efficiency Difficult implementation
Suitable for large databases Node management becomes complex
Efficient indexing —
Page 2