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

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

B-Trees (continued) Analysis of worst-case and average number of disk accesses for an insert. Delete and analysis. Structure for B-tree node

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

View Full Document
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.
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 .

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

View Full Document
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.
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

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

View Full Document
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
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

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

View Full Document
Delete From A Leaf Delete the pair with key = 17 . Deletion from a
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
Ask a homework question - tutors are online