lec23 - B-Trees(continued Analysis of worst-case and...

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

View Full Document Right Arrow Icon
B-Trees (continued) Analysis of worst-case and average number of disk accesses for an insert. Delete and analysis. Structure for B-tree node
Background image of page 1

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

View Full DocumentRight Arrow Icon
Worst-Case Disk Accesses 15 20 4 1 3 5 6 30 40 13 16 17 7 12 9 8 10 Insert 2. Insert 18. Insert 14.
Background image of page 2
Worst-Case Disk Accesses Assume enough memory to hold all h nodes accessed on way down. h read accesses on way down. 2s+1 write accesses on way up, s = number of nodes that split. Total h+2s+1 disk accesses. Max is 3h+1 .
Background image of page 3

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

View Full DocumentRight Arrow Icon
Average Disk Accesses Start with empty B-tree. Insert n pairs. Resulting B-tree has p nodes. # splits <= p –2 , p > 2 . # pairs >= 1+(ceil(m/2) 1)(p 1) . s avg <= (p 2)/(1+(ceil(m/2) 1)(p 1)) . So, s avg < 1/(ceil(m/2) – 1) . m = 200 => s avg < 1/99 . Average disk accesses < h + 2/99 + 1 ~ h + 1 . Nearly minimum.
Background image of page 4
B-Tree – Delete Delete 3. Delete 8. Delete 7. 15 20 4 5 6 30 40 13 16 17 7 12 9 8 10 3
Background image of page 5

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

View Full DocumentRight Arrow Icon
Delete (2-3 tree) Delete the pair with key = 8 . Transform deletion from interior into deletion from a leaf. Replace by largest in left subtree. 15 20 8 1 2 4 5 6 30 40 9 16 17 3
Background image of page 6
Delete From A Leaf Delete the pair with key = 16 . 3 -node becomes 2 -node. 15 20 8 1 2 4 5 6 30 40 9 16 17 3
Background image of page 7

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

View Full DocumentRight Arrow Icon
Delete From A Leaf Delete the pair with key = 17 . Deletion from a
Background image of page 8
Image of page 9
This is the end of the preview. Sign up to access the rest of the document.

This note was uploaded on 12/07/2010 for the course COT 5536 taught by Professor Sartajsahani during the Spring '10 term at University of Florida.

Page1 / 28

lec23 - B-Trees(continued Analysis of worst-case and...

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

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