( ( ) ) ( ) ( ) = = Work = h log t n B- B -Trees - - PDF document

work h log t n b b trees trees b b trees trees
SMART_READER_LITE
LIVE PREVIEW

( ( ) ) ( ) ( ) = = Work = h log t n B- B -Trees - - PDF document

B- B -Trees Trees B B- -Trees Trees Search for key R ( ( ) ) ( ) ( ) = = Work = h log t n B- B -Trees Trees B B- -Trees Trees Each Disk-Read or Disk-Write = one Basic unit of work O(1) Typical Node x


slide-1
SLIDE 1

1

B B-

  • Trees

Trees Search for key R Work =

( ) ( ) ( ) ( )

logt h n Θ = Θ = Θ

B B-

  • Trees

Trees B B-

  • Trees

Trees Each Disk-Read or Disk-Write = one Basic unit of work O(1) B B-

  • Trees

Trees Typical Node x Typical Node x See example on whiteboard

1 # 2 1 t Keys t − ≤ − ≤ ≤ − # 2 t Children t ≤ ≤ ≤ ≤ # 2 1 Keys t node is full = − = − ⇒ 2 t = ⇒ 2-3-4 B-Tree

Each node is approx. one page of HD memory B B-

  • Trees

Trees

Thm: Let T be a B-tree with n>2 keys and of minimum degree . Then the height h of the B-tree is bounded above by

2 t ≥

1 log 2

t

n h +   ≤    

slide-2
SLIDE 2

2

B B-

  • Trees

Trees

( ) ( ) ( ) ( )

logt h n Θ = Θ = Θ

B B-

  • Trees

Trees Search for key R Work =

( ) ( ) ( ) ( )

logt h n Θ = Θ = Θ

B B-

  • Trees

Trees B B-

  • Tree Insertion

Tree Insertion To INSERT, we will need procedures for splitting full nodes B B-

  • Trees

Trees B-Tree-Split B B-

  • Trees

Trees

slide-3
SLIDE 3

3

B B-

  • Trees

Trees B B-

  • Trees

Trees B-Tree-Split B B-

  • Trees

Trees Splitting a root node B B-

  • Trees

Trees Inserting Keys in a B Inserting Keys in a B-

  • Tree

Tree B B-

  • Tree Deletion

Tree Deletion We must make sure that the number of keys in a non-root node is always at least t

slide-4
SLIDE 4

4

Deleting Keys in a B Deleting Keys in a B-

  • Tree

Tree Deleting Keys in a B Deleting Keys in a B-

  • Tree (Cont.)

Tree (Cont.)