































Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
Prepare for your exams
Study with the several resources on Docsity
Earn points to download
Earn points by helping other students or get them with a premium plan
An overview of 2-3 trees, a balanced search tree data structure. The features and benefits of 2-3 trees, including their ease of keeping the tree balanced, and provides examples of inserting and deleting items. The document also compares 2-3 trees to binary search trees.
Typology: Study notes
1 / 39
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