































Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!
































Lecture 20: 2-3 Tree CSCI 2720: Data Structures
Slides Courtesy: Eileen Kraemer
Why care about advanced implementations?
inorder (in ttTree: TwoThreeTree) if (ttTree’s root node r is a leaf) visit the data item(s) else if (r has two data items) { inorder(left subtree of ttTree’s root) visit the first data item inorder(middle subtree of ttTree’s root) visit the second data item inorder(right subtree of ttTree’s root) } else { inorder(left subtree of ttTree’s root) visit the data item inorder(right subtree of ttTree’s root) }
Gain: Ease of Keeping the Tree Balanced
insert in leaf divide leaf and move middle value up to parent overcrowded node
Inserting so far