0% found this document useful (0 votes)
520 views

M-Way Search Tree

The document discusses m-way search trees and 2-3 search trees. It defines an m-way search tree as a tree with m-1 keys and m children. A binary tree is a specific type of 2-way search tree. It then explains that a 2-3 search tree is a tree where every node has either 2 or 3 children and leaf nodes contain data values. The document provides examples of inserting values into 2-3 search trees.

Uploaded by

Akif Vohra
Copyright
© Attribution Non-Commercial (BY-NC)
Available Formats
Download as PPS, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
520 views

M-Way Search Tree

The document discusses m-way search trees and 2-3 search trees. It defines an m-way search tree as a tree with m-1 keys and m children. A binary tree is a specific type of 2-way search tree. It then explains that a 2-3 search tree is a tree where every node has either 2 or 3 children and leaf nodes contain data values. The document provides examples of inserting values into 2-3 search trees.

Uploaded by

Akif Vohra
Copyright
© Attribution Non-Commercial (BY-NC)
Available Formats
Download as PPS, PDF, TXT or read online on Scribd
You are on page 1/ 10

DATA

STRUCTURES

MAHESH GOYANI
MAHATMA GANDHI INSTITUE OF TECHNICAL EDUCATION & RESEARCH CENTER
[email protected]

(C) GOYANI MAHESH 1


M-WAY
SEARCH TREE

(C) GOYANI MAHESH 2


TERMINOLOGY

 Tree having m-1 key and m children is called m-way search tree.
 A binary tree is a 2-way tree. It means it has m-1 = 2-1 = 1 key and
maximum 2 child.
 A Binary Tree is called m-way tree of order 2.

9 20 41

9 20 9 9 20 41

    

9 9 20 9 20 41 9

          

(C) GOYANI MAHESH 3


2-3
SEARCH TREE

(C) GOYANI MAHESH 4


TERMINOLOGY

 Every node in 2-3 tree has two or three children.


 A 2-3 tree is a tree in which leaf nodes are the only nodes that contains
data values.
 All leaf nodes contains two values.
 The first value in non-leaf node is the maximum value of its left subtree.
 The second value of non-leaf node is the maximum value of its middle (or
right) tree.

(C) GOYANI MAHESH 5


13

insert (13)

(C) GOYANI MAHESH 6


13 : 41

13 41

insert (41)

(C) GOYANI MAHESH 7


13 : 41

13 21 41

insert (21)

(C) GOYANI MAHESH 8


13 : 41

7 : 13 21 : 41

7 13 21 41

insert (7)

(C) GOYANI MAHESH 9


13 : 41

7 : 13 21 : 39
41

7 13 18 21 39 41

insert (18),
insert (39)

(C) GOYANI MAHESH 10

You might also like