1 / 16

B-Trees

B-Trees. Text Read Weiss, § 4.7 B-Tree Objects Leaf, Interior Node, Information Packet, B-Tree Deleting Records from a B-Tree Need to combine leaves Need to combine interior nodes. Example Step-Through. Assume Order 3 B-Tree, i.e., L = M = 3 Each leaf can hold at most 3 records

zubin
Télécharger la présentation

B-Trees

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. B-Trees • Text • Read Weiss, §4.7 • B-Tree Objects • Leaf, Interior Node, Information Packet, B-Tree • Deleting Records from a B-Tree • Need to combine leaves • Need to combine interior nodes

  2. Example Step-Through • Assume Order 3 B-Tree, i.e., L = M = 3 • Each leaf can hold at most 3 records • Each interior node can hold at most 2 keys and 3 references to children

  3. ● 15 ● 35● root ● 6 ● 12 ● ● 17 ● 27● ● 42 ● 54● 4 5 12 13 15 16 17 24 27 29 31 35 39 42 47 54 59 61 6 7 Start with an already initialized B-Tree

  4. ● 15 ● 35● root ● 6 ● 12 ● ● 17 ● 27● ● 42 ● 54● 4 5 12 13 15 16 17 24 27 29 31 35 39 42 47 54 59 61 6 7 Delete 27

  5. ● 15 ● 35● root ● 6 ● 12 ● ● 17 ● 29● ● 42 ● 54● 4 5 12 13 15 16 17 24 29 31 35 39 42 47 54 59 61 6 7 Delete 61

  6. ● 15 ● 35● root ● 6 ● 12 ● ● 17 ● 29● ● 42 ● 54● 4 5 12 13 15 16 17 24 29 31 35 39 42 47 54 59 6 7 Delete 61

  7. ● 15 ● 35● root ● 6 ● 12 ● ● 17 ● 29● ● 42 ● 54● 4 5 12 13 15 16 17 24 29 31 35 39 42 47 54 59 6 7 Delete 35

  8. ● 15 ● 39 ● root ● 6 ● 12 ● ● 17 ● 29● ● 42 ● 54● 4 5 12 13 15 16 17 24 29 31 39 42 47 54 59 6 7 Policy: Allow 39 to remain alone in leaf

  9. ● 15 ● 39 ● root ● 6 ● 12 ● ● 17 ● 29● ● 42 ● 54● 4 5 12 13 15 16 17 24 29 31 39 42 47 54 59 6 7 Delete 39

  10. ● 15 ● 39 ● root ● 6 ● 12 ● ● 17 ● 29● ● 42 ● 54● 4 5 12 13 15 16 17 24 29 31 42 47 54 59 6 7 Delete 39

  11. ● 15 ● 42 ● root ● 6 ● 12 ● ● 17 ● 29● ● 54 ● __● 4 5 12 13 15 16 17 24 29 31 42 47 54 59 6 7 Delete 39

  12. ● 15● 42 ● root ● 6 ● 12 ● ● 17 ● 29● ● 54 ● __● 4 5 12 13 15 16 17 24 29 31 42 47 54 59 6 7 Delete 15, 16

  13. ● 17 ● 42● root ● 6 ● 12 ● ● 29 ● __● ● 54 ● __● 4 5 12 13 17 24 29 31 42 47 54 59 6 7 Delete 35, 39, 15, 16

  14. ● 17 ● 42● root ● 6 ● 12 ● ● 29 ● __● ● 54● __● 4 5 12 13 17 24 29 31 42 47 54 59 6 7 Delete 54, 59

  15. ● 17 ● 42● root ● 6 ● 12 ● ● 29 ● __● ● __ ● __● 4 5 12 13 17 24 29 31 42 47 6 7 Must move leaf

  16. ● 17 ● __● root ● 6 ● 12 ● ● 29 ● 42 ● 4 5 12 13 17 24 29 31 42 47 6 7 Must move leaf (adoption of child)

More Related