notes56

notes56 - CS251 Class Notes - March 6th-10th, Spring 2006...

Info iconThis preview shows pages 1–3. Sign up to view the full content.

View Full Document Right Arrow Icon
CS251 Class Notes - March 6th-10th, Spring 2006 2-4 Tree Deletion - Find the key with simple multi-way search from root Case 1 - if node found has external children, just remove key Node found has external children. It is removed. Case 2 - if item to delete has no external children 1.) Find item that precedes inorder traversal 2.) Put this item instead of the item to remove 3.) All removal of keys of internal nodes can be simplified this way Node with key preceding 11 (10) is found and put in place of node with key 11. Case 3 - if key to remove is the last key in the node, removing the key will cause underflow 1.) Pull key from parent and replace it with a key from a sibling (this is called a transfer) The key to be removed is replaced by its parent and the parent is replaced by a sibling of the key to be removed. Case 4 - assume sibling has only 1 key. if this is the case, we fuse the children after taking 1 item from the parent This underflow can cascade up to the top of the tree
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Another example:
Background image of page 2
Image of page 3
This is the end of the preview. Sign up to access the rest of the document.

Page1 / 6

notes56 - CS251 Class Notes - March 6th-10th, Spring 2006...

This preview shows document pages 1 - 3. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online