# 24Trees01 - Multiway Trees A multiway tree is one where you...

This preview shows pages 1–3. Sign up to view the full content.

Multiway Trees A multiway tree is one where you can store more than one value in a node. Now the question becomes, if you can store more than one value in a node, how do you arrange subtrees? If a node contains k items, (let these be I 1 , I 2 , . .. and I k , in numeric order), then that node will contain k+1 subtrees. (Let these subtrees be S 1 , S 2 , . .. and S k+1 .) In order to create a search tree with a reasonable order, we have to place constraints on the values stored in each subtree. In particular we have: All values in S 1 are less than I 1 . All values in S 2 are less than I 2 , but greater than I 1 . All values in S 3 are less than I 3 , but greater than I 2 . ... All values in S k are less than I k , but greater than I k-1 . All values in S k+1 are greater than I k . From this point on, if I refer to a subtree to the left of a value, I m , I am referring to the subtree directly to the left of the value, S m . Also, I will refer to S m+1 as the subtree to the right of I m . Here is an example of a multiway tree: 20, 40 / | \ 5, 8, 13, 17 30 50, 70, 80 / | \ / / | | \ 2 10 14 22, 25 43 60 71 81,87

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document
2-4 Trees A 2-4 Tree is a specific type of multitree. Here are the
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}

### Page1 / 6

24Trees01 - Multiway Trees A multiway tree is one where you...

This preview shows document pages 1 - 3. Sign up to view the full document.

View Full Document
Ask a homework question - tutors are online