lec1029-BTreeAnalysis-ann

# lec1029-BTreeAnalysis-ann - Announcements MP 5 available...

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

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

View Full Document

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

View Full Document

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

View Full Document

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

View Full Document
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: Announcements: MP 5 available. Due 10/31. 11:59p. (2 day extension) Exam 2 - 11/2, 7-9p Today: BTrees — Weiss 4.7 http://people.ksp.skl~kuko/bak/bigl Deﬁnition of a B-tree B-tree of order m is an m-way tree For an internal node. # keys = #children -1 All leaves are on the same level All leaves hoId no more than m-1 keys kg“ All non-root internal nodes have between [ m12 ] and m i ren E,- Root can be a leaf or have between 2 and m children. Keys in a node are ordered. @9439»):- , - at! Searching 3 B-tree 8'7“ may (' b) boo]. B-TREE-SEARCH(Btrev_-Node 8 x, 1‘ key)( . ‘ in! 1 - 0; e “a —.>vh1.1e (I1 < x.numkeya) 88 (key > x.key[1])lé“o’,o‘I L. ‘91! a) Li. [key -- x.ke [11H 7 '—)xt (x.1 ® 1: “else _)Bt reoNode - Analysis of B-Trees (order m) The height of the B-tree determines the number of disk seeks possible in a search for data. We want to be able to say that the height the structure and thus the number of disk seeks is no more than . 0 "up bl a if {#Otw " As we saw in the case of AVL trees. finding an upper bound on the height (given n) is the same as ﬁnding a lower bound on the number of nodes (given h). 0 We seek a relationship between the height of the structure (h) and the amount of data it contains (n). Analysis of B-Trees (order m) We seek a relationship between the height of the structure (h) and the amount of date it contains (n). - The mmnumber of m in each level of a B-tree of order m: (For your convenience, let t = In], I .) L023 ' level 1 2 ‘ iii: In nut level [1 2 kt" - The Wﬂomw is the sum of these: |+ 22%} = l+ 105"" ) pa L": - So. the newm is: '* 2 Wigi: :23-1 W Wm)“ Analysis of B-Trees (order m) We seek a relationship between the height of the structure (h) and the amount of data it contains (continued. . .) - So. the least total number of items is: a 29-: - rewrite as an inequality about n. the total number of keys: ﬂ 7/ Dik- ‘ - rewrite that as an inequality about h. the height of the tree (note that this bounds the number of disk seeks): 4 H - 1‘ ~ “igﬂvﬂ- 000w Summary B-Tree search: . w, +9 O(m)time per node 0 ‘ﬂm‘ M‘- cow” “F . 0(Iogm n) height a up 9nd,, ‘23:. in em - mu (~ in o 0 Insert and Delete have similar stories. W What you should know: Motivation Deﬁnition ., as 9;“ Mt +. Search algorithm and analysis _ u _ . How one mi ht look on disk» [dd 0 ﬂat on a. Mf‘w" ‘, tl" “41% W‘- S “lam” W ¥* What you sh ot know: Insert and Delete ...
View Full Document

{[ snackBarMessage ]}

### Page1 / 8

lec1029-BTreeAnalysis-ann - Announcements MP 5 available...

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

View Full Document
Ask a homework question - tutors are online