Delete 'F', 'E', 'V' from 2-3 Tree

  • Thread starter Thread starter ooohffff
  • Start date Start date
  • Tags Tags
    trees
Join the discussion
Registration is free. Ask a follow-up in this thread, or start your own.
1 reply · 2K views
ooohffff
Messages
74
Reaction score
1

Homework Statement


(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.

Homework Equations


Min = 1
Max = 2

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

  • unnamed.jpg
    unnamed.jpg
    32.2 KB · Views: 400
Physics news on Phys.org
Hi,

How about just removing the 'V' node ? It has no subsets, so nothing replaces it.
ooohffff said:
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' ?