• Support PF! Buy your school textbooks, materials and every day products via PF Here!

2-3 B-Tree Deletion

1. The problem statement, all variables and given/known data
(P)
/ \
(F) (U)
/ \ / \
(D, E) (J, O) (T) (V)

Given the 2-3 tree, delete F E V from the tree in the given order. Show the tree after each deletion.
2. Relevant equations
Min = 1
Max = 2

3. The attempt at a solution
unnamed.jpg


Remove 'V' : Not sure what to do here

Am I doing this correctly? The algorithm in my book says to replace the target at data(i) with the largest item in subset(i) (rightmost child of left subtree), if I found the target at a node.
 

Attachments

BvU

Science Advisor
Homework Helper
11,984
2,632
Hi,

How about just removing the 'V' node ? It has no subsets, so nothing replaces it.
replace the target at data(i) with the largest item in subset(i) (rightmost child of left subtree)
Can you explain how you remove 'E' ?
 

Want to reply to this thread?

"2-3 B-Tree Deletion" You must log in or register to reply here.

Physics Forums Values

We Value Quality
• Topics based on mainstream science
• Proper English grammar and spelling
We Value Civility
• Positive and compassionate attitudes
• Patience while debating
We Value Productivity
• Disciplined to remain on-topic
• Recognition of own weaknesses
• Solo and co-op problem solving
Top