













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!














Binarysearch trees
Non-binarysearch tree
10 > 2, left5 > 2, left2 = 2, found
5 > 2, left2 = 2, found
10 < 25, right30 > 25, left25 = 25, found
5 < 25, right45 > 25, left30 > 25, left10 < 25, right25 = 25, found
// must delete internal node a) Replace with largest value Y on left subtree
OR^ smallest value Z on right subtree b)^ Delete
replacement value (Y or Z) from subtree
10 < 25, right30 > 25, left25 = 25, delete 45
Replacing 10with^
smallest value in rightsubtree
Deleting leaf
Resulting tree
88
44 17
78
32
(^5048)
62
Sortedorder!