際際滷

際際滷Share a Scribd company logo
11 
BB++ -- TTrreeee && BB -- TTrreeee 
MM VV BB RREEDDDDYY 
GGIITTAAMM UUNNIIVVEERRSSIITTYY 
BBEENNGGAALLUURRUU
22 
AAggeennddaa 
BB++ -- TTrreeee SSttrruuccttuurree 
BB++ -- TTrreeee UUppddaatteess 
BB++ -- TTrreeee FFiillee OOrrggaanniizzaattiioonn 
BB -- TTrreeee IInnddeexx FFiilleess
33 
BB++ -- TTrreeee SSttrruuccttuurree 
AA BB++ -- TTrreeee iiss iinn tthhee ffoorrmm ooff aa bbaallaanncceedd ttrreeee iinn 
wwhhiicchh eevveerryy ppaatthh ffrroomm tthhee rroooott ooff tthhee ttrreeee ttoo aa 
lleeaaff ooff tthhee ttrreeee iiss tthhee ssaammee lleennggtthh.. 
EEaacchh nnoonnlleeaaff nnooddee iinn tthhee ttrreeee hhaass bbeettwweeeenn [[nn//22]] 
aanndd nn cchhiillddrreenn,, wwhheerree nn iiss ffiixxeedd.. 
BB++ -- TTrreeeess aarree ggoooodd ffoorr sseeaarrcchheess,, bbuutt ccaauussee 
ssoommee oovveerrhheeaadd iissssuueess iinn wwaasstteedd ssppaaccee..
A typical node ccoonnttaaiinnss uupp ttoo nn  11 sseeaarrcchh kkeeyy 
vvaalluueess KK11,, KK22,,,, KKnn--11,, aanndd nn ppooiinntteerrss PP11,, PP22,, 
,, PPnn.. TThhee sseeaarrcchh kkeeyy vvaalluueess aarree kkeepptt iinn ssoorrtteedd 
oorrddeerr.. 
44 
P1 K1 P2  Pn-1 Kn-1 Pn
55 
The pointer Pi can point ttoo eeiitthheerr aa ffiillee rreeccoorrdd oorr 
aa bbuucckkeett ooff ppooiinntteerrss wwhhiicchh eeaacchh ppooiinntt ttoo aa ffiillee 
rreeccoorrdd.. 
lleeaaff nnooddee,, nn == 33 
Brighton Downtown 
A  212 Brighton 750 
A  101 Brighton 750 
A  212 Brighton 750 
...
66 
Each leaf can hhoolldd uupp ttoo nn  11 vvaalluueess aanndd mmuusstt 
ccoonnttaaiinn aatt lleeaasstt [[((nn  11)) // 22]] vvaalluueess.. 
NNoonnlleeaaff nnooddee ppooiinntteerrss ppooiinntt ttoo ttrreeee nnooddeess ((lleeaaff 
nnooddeess)).. NNoonnlleeaaff nnooddeess ccaann hhoolldd uupp ttoo nn ppooiinntteerrss 
aanndd mmuusstt hhoolldd aatt lleeaasstt [[nn//22]] ppooiinntteerrss.. 
ii..ee.. nn == 33 
Perryridge 
Mianus Redwood 
Brighton Downtown Mianus Redwood Round Hill 
Perryridge
77 
BB++ -- TTrreeee UUppddaatteess 
IInnsseerrttiioonn  IIff tthhee nneeww nnooddee hhaass aa sseeaarrcchh kkeeyy tthhaatt 
aallrreeaaddyy eexxiissttss iinn aannootthheerr lleeaaff nnooddee,, tthheenn iitt aaddddss 
tthhee nneeww rreeccoorrdd ttoo tthhee ffiillee aanndd aa ppooiinntteerr ttoo tthhee 
bbuucckkeett ooff ppooiinntteerrss.. IIff tthhee sseeaarrcchh kkeeyy iiss ddiiffffeerreenntt 
ffrroomm aallll ootthheerrss,, iitt iiss iinnsseerrtteedd iinn oorrddeerr.. 
DDeelleettiioonn  IItt rreemmoovveess tthhee sseeaarrcchh kkeeyy vvaalluuee ffrroomm 
tthhee nnooddee..
88 
i.e. we are ggooiinngg ttoo iinnsseerrtt aa nnooddee wwiitthh aa sseeaarrcchh 
kkeeyy vvaalluuee CClleeaarrvviieeww.. WWee ffiinndd tthhaatt CClleeaarrvviieeww 
sshhoouulldd bbee iinn tthhee nnooddee wwiitthh BBrriigghhttoonn aanndd 
DDoowwnnttoowwnn,, ssoo wwee mmuusstt sspplliitt tthhee nnooddee.. 
ii..ee.. nn == 33 
Perryridge 
Downtown Mianus Redwood 
Brighton Clearview Mianus Redwood Round Hill 
Perryridge 
Downtown
99 
i.e. Deletion ooff DDoowwnnttoowwnn ffrroomm sslliiddee ##88.. 
Perryridge 
Mianus Redwood 
Brighton Clearview Mianus Redwood Round Hill 
Perryridge
1100 
ii..ee.. DDeelleettiioonn ooff PPeerrrryyrriiddggee ffrroomm sslliiddee ##88 
Mianus 
Downtown Redwood 
Brighton Clearview Mianus Redwood Round Hill 
Downtown
BB++ -- TTrreeee FFiillee OOrrggaanniizzaattiioonn 
IInn aa BB++ -- TTrreeee ffiillee oorrggaanniizzaattiioonn,, tthhee lleeaaff nnooddeess ooff tthhee ttrreeee 
ssttoorreess tthhee aaccttuuaall rreeccoorrdd rraatthheerr tthhaann ssttoorriinngg ppooiinntteerrss ttoo 
rreeccoorrddss.. 
DDuurriinngg iinnsseerrttiioonn,, tthhee ssyysstteemm llooccaatteess tthhee bblloocckk tthhaatt 
sshhoouulldd ccoonnttaaiinn tthhee rreeccoorrdd.. IIff tthheerree iiss eennoouugghh ffrreeee ssppaaccee 
iinn tthhee nnooddee tthheenn tthhee ssyysstteemm ssttoorreess iitt.. OOtthheerrwwiissee tthhee 
ssyysstteemm sspplliittss tthhee rreeccoorrdd iinn ttwwoo aanndd ddiissttrriibbuutteess tthhee 
rreeccoorrddss.. 
DDuurriinngg ddeelleettiioonn,, tthhee ssyysstteemm ffiirrsstt rreemmoovveess tthhee rreeccoorrdd ffrroomm 
tthhee bblloocckk ccoonnttaaiinniinngg iitt.. IIff tthhee bblloocckk bbeeccoommeess lleessss tthhaann 
hhaallff ffuullll aass aa rreessuulltt,, tthhee rreeccoorrddss iinn tthhee bblloocckk aarree 
rreeddiissttrriibbuutteedd.. 
1111
1122 
BB++ -- TTrreeee FFiillee OOrrggaanniizzaattiioonn
1133 
BB -- TTrreeee IInnddeexx FFiilleess 
Similar to B+-tree, but B-tree allows search-key values to appear only 
once; eliminates redundant storage of search keys. 
Search keys in nonleaf nodes appear nowhere else in the B-tree; an 
additional pointer field for each search key in a nonleaf node must be 
included. 
NNoonnlleeaaff nnooddee  ppooiinntteerrss BBii aarree tthhee bbuucckkeett oorr ffiillee rreeccoorrdd ppooiinntteerrss..
1144 
BB  TTrreeee IInnddeexx FFiilleess 
AAddvvaannttaaggeess ooff BB--TTrreeee iinnddiicceess:: 
 MMaayy uussee lleessss ttrreeee nnooddeess tthhaann aa ccoorrrreessppoonnddiinngg BB++--TTrreeee.. 
 SSoommeettiimmeess ppoossssiibbllee ttoo ffiinndd sseeaarrcchh--kkeeyy vvaalluuee bbeeffoorree rreeaacchhiinngg 
lleeaaff nnooddee.. 
DDiissaaddvvaannttaaggeess ooff BB--TTrreeee iinnddiicceess:: 
 OOnnllyy ssmmaallll ffrraaccttiioonn ooff aallll sseeaarrcchh--kkeeyy vvaalluueess aarree ffoouunndd eeaarrllyy 
 NNoonn--lleeaaff nnooddeess aarree llaarrggeerr,, ssoo ffaann--oouutt iiss rreedduucceedd.. TThhuuss BB--TTrreeeess 
ttyyppiiccaallllyy hhaavvee ggrreeaatteerr ddeepptthh tthhaann ccoorrrreessppoonnddiinngg 
BB++--TTrreeee 
 IInnsseerrttiioonn aanndd ddeelleettiioonn mmoorree ccoommpplliiccaatteedd tthhaann iinn BB++--TTrreeeess 
 IImmpplleemmeennttaattiioonn iiss hhaarrddeerr tthhaann BB++--TTrreeeess..
1155 
EExxaammppllee ooff BB  TTrreeee

More Related Content

What's hot (17)

demand
demanddemand
demand
NCDB
Diodes
DiodesDiodes
Diodes
Harssha BalaMurali
What Makes a Successful Church
What Makes a Successful ChurchWhat Makes a Successful Church
What Makes a Successful Church
Great Oaks Church of Christ
Moringa breastfeeding-pregnant-lactating-mothers
Moringa breastfeeding-pregnant-lactating-mothersMoringa breastfeeding-pregnant-lactating-mothers
Moringa breastfeeding-pregnant-lactating-mothers
Drumstick Moringa
Rational zero of polynomial function
Rational zero of polynomial functionRational zero of polynomial function
Rational zero of polynomial function
Department of Education
Seniors, Welcome back! gks 2012.final
Seniors, Welcome back! gks 2012.finalSeniors, Welcome back! gks 2012.final
Seniors, Welcome back! gks 2012.final
Kevin O'Brien
Oh, You Better Watch Out
Oh, You Better Watch OutOh, You Better Watch Out
Oh, You Better Watch Out
Plymouth Meeting E. C. Church
Lesson 7 day 2
Lesson 7 day 2Lesson 7 day 2
Lesson 7 day 2
Claudia Maricela Velasquez
Realpp
RealppRealpp
Realpp
lookatme_
History humayun the fortune
History humayun the fortuneHistory humayun the fortune
History humayun the fortune
Sukhanpreet Kaur Rangi
Writing an Essay
Writing an EssayWriting an Essay
Writing an Essay
ccgibson01
Coma mixedematoso
Coma mixedematoso Coma mixedematoso
Coma mixedematoso
Chapelet25
Kinds of sentences flash cards
Kinds of sentences flash cardsKinds of sentences flash cards
Kinds of sentences flash cards
Kourtney Moscarello
Lesson 6 day 2
Lesson 6 day 2Lesson 6 day 2
Lesson 6 day 2
Claudia Maricela Velasquez
Tipos de roquedo de la pen鱈nsula ib辿rica
Tipos de roquedo de la pen鱈nsula ib辿ricaTipos de roquedo de la pen鱈nsula ib辿rica
Tipos de roquedo de la pen鱈nsula ib辿rica
josepsenabre

Viewers also liked (7)

Week 5 open session
Week 5 open sessionWeek 5 open session
Week 5 open session
Randall Rode
C UNIT-3 PREPARED BY M V B REDDY
C UNIT-3 PREPARED BY M V B REDDYC UNIT-3 PREPARED BY M V B REDDY
C UNIT-3 PREPARED BY M V B REDDY
Rajeshkumar Reddy
Week6 office-hours
Week6 office-hoursWeek6 office-hours
Week6 office-hours
Randall Rode
Week3 office hours
Week3 office hoursWeek3 office hours
Week3 office hours
Randall Rode
Dreamforce 2015
Dreamforce 2015Dreamforce 2015
Dreamforce 2015
Michael Levy
Week4 office hours
Week4 office hoursWeek4 office hours
Week4 office hours
Randall Rode
从舒亳仆仆舒 舒亰弍从舒
从舒亳仆仆舒 舒亰弍从舒从舒亳仆仆舒 舒亰弍从舒
从舒亳仆仆舒 舒亰弍从舒
face333
Week 5 open session
Week 5 open sessionWeek 5 open session
Week 5 open session
Randall Rode
C UNIT-3 PREPARED BY M V B REDDY
C UNIT-3 PREPARED BY M V B REDDYC UNIT-3 PREPARED BY M V B REDDY
C UNIT-3 PREPARED BY M V B REDDY
Rajeshkumar Reddy
Week6 office-hours
Week6 office-hoursWeek6 office-hours
Week6 office-hours
Randall Rode
Week3 office hours
Week3 office hoursWeek3 office hours
Week3 office hours
Randall Rode
Dreamforce 2015
Dreamforce 2015Dreamforce 2015
Dreamforce 2015
Michael Levy
Week4 office hours
Week4 office hoursWeek4 office hours
Week4 office hours
Randall Rode
从舒亳仆仆舒 舒亰弍从舒
从舒亳仆仆舒 舒亰弍从舒从舒亳仆仆舒 舒亰弍从舒
从舒亳仆仆舒 舒亰弍从舒
face333

Similar to B-TREE PREPARED BY M V BRAHMANANDA REDDY (20)

Chpt 7 part 1 - chemical nomenclature 042403
Chpt  7   part 1 - chemical nomenclature 042403Chpt  7   part 1 - chemical nomenclature 042403
Chpt 7 part 1 - chemical nomenclature 042403
phspsquires
Rehab for sick_units
Rehab for sick_unitsRehab for sick_units
Rehab for sick_units
Rashmi Sinha
six stroke engine...
six stroke engine...six stroke engine...
six stroke engine...
BZU lahore
pre-prosthetic surgery
 pre-prosthetic surgery pre-prosthetic surgery
pre-prosthetic surgery
vasanramkumar
Obstacles connaissement
Obstacles connaissementObstacles connaissement
Obstacles connaissement
Rabah HELAL
Biotechnology and genetic engineering
Biotechnology and genetic engineeringBiotechnology and genetic engineering
Biotechnology and genetic engineering
Naveen Gupta
Symmetry and group theory
Symmetry and group theorySymmetry and group theory
Symmetry and group theory
Rawat DA Greatt
3捉 tipos de pesquisa
3捉 tipos de pesquisa3捉 tipos de pesquisa
3捉 tipos de pesquisa
Su棚nya Mour達o
19 human research 2
19 human research 219 human research 2
19 human research 2
emmavan
Symmetry and group theory
Symmetry and group theorySymmetry and group theory
Symmetry and group theory
chemistry50
Chapter 8 Erosional Forces
Chapter 8 Erosional ForcesChapter 8 Erosional Forces
Chapter 8 Erosional Forces
Kristin Bowling
Speaker ppt
Speaker pptSpeaker ppt
Speaker ppt
Anubhav Sokhal
Water for presentation
Water for presentationWater for presentation
Water for presentation
Vedpal Yadav
Diarrh辿e aigu谷 du nourrisson
Diarrh辿e aigu谷 du nourrisson Diarrh辿e aigu谷 du nourrisson
Diarrh辿e aigu谷 du nourrisson
Rachid AOURAGH
Shocking cinema-introduction
Shocking cinema-introduction Shocking cinema-introduction
Shocking cinema-introduction
JenniferAnnTrimnell
Past tenses for Bachillerato
Past tenses for Bachillerato Past tenses for Bachillerato
Past tenses for Bachillerato
MyStudentsLearning
Comandos para dise単o de p叩gina Web
Comandos para dise単o de p叩gina WebComandos para dise単o de p叩gina Web
Comandos para dise単o de p叩gina Web
Armando Bond
#6 digestive system general maintenance and disorders
#6 digestive system general maintenance and disorders#6 digestive system general maintenance and disorders
#6 digestive system general maintenance and disorders
Home Makers
Trout jaspreet singh
Trout jaspreet singhTrout jaspreet singh
Trout jaspreet singh
Jaspreet Singh
Islamic economics
Islamic economicsIslamic economics
Islamic economics
Khalid Abdullah
Chpt 7 part 1 - chemical nomenclature 042403
Chpt  7   part 1 - chemical nomenclature 042403Chpt  7   part 1 - chemical nomenclature 042403
Chpt 7 part 1 - chemical nomenclature 042403
phspsquires
Rehab for sick_units
Rehab for sick_unitsRehab for sick_units
Rehab for sick_units
Rashmi Sinha
six stroke engine...
six stroke engine...six stroke engine...
six stroke engine...
BZU lahore
pre-prosthetic surgery
 pre-prosthetic surgery pre-prosthetic surgery
pre-prosthetic surgery
vasanramkumar
Obstacles connaissement
Obstacles connaissementObstacles connaissement
Obstacles connaissement
Rabah HELAL
Biotechnology and genetic engineering
Biotechnology and genetic engineeringBiotechnology and genetic engineering
Biotechnology and genetic engineering
Naveen Gupta
Symmetry and group theory
Symmetry and group theorySymmetry and group theory
Symmetry and group theory
Rawat DA Greatt
19 human research 2
19 human research 219 human research 2
19 human research 2
emmavan
Symmetry and group theory
Symmetry and group theorySymmetry and group theory
Symmetry and group theory
chemistry50
Chapter 8 Erosional Forces
Chapter 8 Erosional ForcesChapter 8 Erosional Forces
Chapter 8 Erosional Forces
Kristin Bowling
Water for presentation
Water for presentationWater for presentation
Water for presentation
Vedpal Yadav
Diarrh辿e aigu谷 du nourrisson
Diarrh辿e aigu谷 du nourrisson Diarrh辿e aigu谷 du nourrisson
Diarrh辿e aigu谷 du nourrisson
Rachid AOURAGH
Shocking cinema-introduction
Shocking cinema-introduction Shocking cinema-introduction
Shocking cinema-introduction
JenniferAnnTrimnell
Past tenses for Bachillerato
Past tenses for Bachillerato Past tenses for Bachillerato
Past tenses for Bachillerato
MyStudentsLearning
Comandos para dise単o de p叩gina Web
Comandos para dise単o de p叩gina WebComandos para dise単o de p叩gina Web
Comandos para dise単o de p叩gina Web
Armando Bond
#6 digestive system general maintenance and disorders
#6 digestive system general maintenance and disorders#6 digestive system general maintenance and disorders
#6 digestive system general maintenance and disorders
Home Makers
Trout jaspreet singh
Trout jaspreet singhTrout jaspreet singh
Trout jaspreet singh
Jaspreet Singh

More from Malikireddy Bramhananda Reddy (20)

M v bramhananda reddy dsa complete notes
M v bramhananda reddy dsa complete notesM v bramhananda reddy dsa complete notes
M v bramhananda reddy dsa complete notes
Malikireddy Bramhananda Reddy
AVL TREE PREPARED BY M V BRAHMANANDA REDDY
AVL TREE PREPARED BY M V BRAHMANANDA REDDYAVL TREE PREPARED BY M V BRAHMANANDA REDDY
AVL TREE PREPARED BY M V BRAHMANANDA REDDY
Malikireddy Bramhananda Reddy
DATASTRUCTURES PPTS PREPARED BY M V BRAHMANANDA REDDY
DATASTRUCTURES PPTS PREPARED BY M V BRAHMANANDA REDDYDATASTRUCTURES PPTS PREPARED BY M V BRAHMANANDA REDDY
DATASTRUCTURES PPTS PREPARED BY M V BRAHMANANDA REDDY
Malikireddy Bramhananda Reddy
DATA STRUCTURES AND ALGORITHMS UNIT-3 TREES PREPARED BY M V BRAHMANANDA REDDY
DATA STRUCTURES AND ALGORITHMS UNIT-3 TREES PREPARED BY M V BRAHMANANDA REDDYDATA STRUCTURES AND ALGORITHMS UNIT-3 TREES PREPARED BY M V BRAHMANANDA REDDY
DATA STRUCTURES AND ALGORITHMS UNIT-3 TREES PREPARED BY M V BRAHMANANDA REDDY
Malikireddy Bramhananda Reddy
Datastructures and algorithms prepared by M.V.Brehmanada Reddy
Datastructures and algorithms prepared by M.V.Brehmanada ReddyDatastructures and algorithms prepared by M.V.Brehmanada Reddy
Datastructures and algorithms prepared by M.V.Brehmanada Reddy
Malikireddy Bramhananda Reddy
C LANGUAGE UNIT-1 PREPARED BY M V BRAHMANANDA REDDY
C LANGUAGE UNIT-1 PREPARED BY M V BRAHMANANDA REDDYC LANGUAGE UNIT-1 PREPARED BY M V BRAHMANANDA REDDY
C LANGUAGE UNIT-1 PREPARED BY M V BRAHMANANDA REDDY
Malikireddy Bramhananda Reddy
DATASTRUCTURES UNIT-1
DATASTRUCTURES UNIT-1DATASTRUCTURES UNIT-1
DATASTRUCTURES UNIT-1
Malikireddy Bramhananda Reddy
Data representation UNIT-1
Data representation UNIT-1Data representation UNIT-1
Data representation UNIT-1
Malikireddy Bramhananda Reddy
C SLIDES PREPARED BY M V B REDDY
C SLIDES PREPARED BY  M V B REDDYC SLIDES PREPARED BY  M V B REDDY
C SLIDES PREPARED BY M V B REDDY
Malikireddy Bramhananda Reddy
C AND DATASTRUCTURES PREPARED BY M V B REDDY
C AND DATASTRUCTURES PREPARED BY M V B REDDYC AND DATASTRUCTURES PREPARED BY M V B REDDY
C AND DATASTRUCTURES PREPARED BY M V B REDDY
Malikireddy Bramhananda Reddy
C PROGRAMS
C PROGRAMSC PROGRAMS
C PROGRAMS
Malikireddy Bramhananda Reddy
C LANGUAGE NOTES
C LANGUAGE NOTESC LANGUAGE NOTES
C LANGUAGE NOTES
Malikireddy Bramhananda Reddy
C notes by m v b reddy(gitam)imp notes all units notes 5 unit order
C notes by m v b  reddy(gitam)imp  notes  all units notes  5 unit orderC notes by m v b  reddy(gitam)imp  notes  all units notes  5 unit order
C notes by m v b reddy(gitam)imp notes all units notes 5 unit order
Malikireddy Bramhananda Reddy
Vcs29
Vcs29Vcs29
Vcs29
Malikireddy Bramhananda Reddy
Vcs28
Vcs28Vcs28
Vcs28
Malikireddy Bramhananda Reddy
Vcs26
Vcs26Vcs26
Vcs26
Malikireddy Bramhananda Reddy
Vcs24
Vcs24Vcs24
Vcs24
Malikireddy Bramhananda Reddy
Vcs23
Vcs23Vcs23
Vcs23
Malikireddy Bramhananda Reddy
Vcs22
Vcs22Vcs22
Vcs22
Malikireddy Bramhananda Reddy
DATASTRUCTURES PPTS PREPARED BY M V BRAHMANANDA REDDY
DATASTRUCTURES PPTS PREPARED BY M V BRAHMANANDA REDDYDATASTRUCTURES PPTS PREPARED BY M V BRAHMANANDA REDDY
DATASTRUCTURES PPTS PREPARED BY M V BRAHMANANDA REDDY
Malikireddy Bramhananda Reddy
DATA STRUCTURES AND ALGORITHMS UNIT-3 TREES PREPARED BY M V BRAHMANANDA REDDY
DATA STRUCTURES AND ALGORITHMS UNIT-3 TREES PREPARED BY M V BRAHMANANDA REDDYDATA STRUCTURES AND ALGORITHMS UNIT-3 TREES PREPARED BY M V BRAHMANANDA REDDY
DATA STRUCTURES AND ALGORITHMS UNIT-3 TREES PREPARED BY M V BRAHMANANDA REDDY
Malikireddy Bramhananda Reddy
Datastructures and algorithms prepared by M.V.Brehmanada Reddy
Datastructures and algorithms prepared by M.V.Brehmanada ReddyDatastructures and algorithms prepared by M.V.Brehmanada Reddy
Datastructures and algorithms prepared by M.V.Brehmanada Reddy
Malikireddy Bramhananda Reddy
C LANGUAGE UNIT-1 PREPARED BY M V BRAHMANANDA REDDY
C LANGUAGE UNIT-1 PREPARED BY M V BRAHMANANDA REDDYC LANGUAGE UNIT-1 PREPARED BY M V BRAHMANANDA REDDY
C LANGUAGE UNIT-1 PREPARED BY M V BRAHMANANDA REDDY
Malikireddy Bramhananda Reddy
C notes by m v b reddy(gitam)imp notes all units notes 5 unit order
C notes by m v b  reddy(gitam)imp  notes  all units notes  5 unit orderC notes by m v b  reddy(gitam)imp  notes  all units notes  5 unit order
C notes by m v b reddy(gitam)imp notes all units notes 5 unit order
Malikireddy Bramhananda Reddy

B-TREE PREPARED BY M V BRAHMANANDA REDDY

  • 1. 11 BB++ -- TTrreeee && BB -- TTrreeee MM VV BB RREEDDDDYY GGIITTAAMM UUNNIIVVEERRSSIITTYY BBEENNGGAALLUURRUU
  • 2. 22 AAggeennddaa BB++ -- TTrreeee SSttrruuccttuurree BB++ -- TTrreeee UUppddaatteess BB++ -- TTrreeee FFiillee OOrrggaanniizzaattiioonn BB -- TTrreeee IInnddeexx FFiilleess
  • 3. 33 BB++ -- TTrreeee SSttrruuccttuurree AA BB++ -- TTrreeee iiss iinn tthhee ffoorrmm ooff aa bbaallaanncceedd ttrreeee iinn wwhhiicchh eevveerryy ppaatthh ffrroomm tthhee rroooott ooff tthhee ttrreeee ttoo aa lleeaaff ooff tthhee ttrreeee iiss tthhee ssaammee lleennggtthh.. EEaacchh nnoonnlleeaaff nnooddee iinn tthhee ttrreeee hhaass bbeettwweeeenn [[nn//22]] aanndd nn cchhiillddrreenn,, wwhheerree nn iiss ffiixxeedd.. BB++ -- TTrreeeess aarree ggoooodd ffoorr sseeaarrcchheess,, bbuutt ccaauussee ssoommee oovveerrhheeaadd iissssuueess iinn wwaasstteedd ssppaaccee..
  • 4. A typical node ccoonnttaaiinnss uupp ttoo nn 11 sseeaarrcchh kkeeyy vvaalluueess KK11,, KK22,,,, KKnn--11,, aanndd nn ppooiinntteerrss PP11,, PP22,, ,, PPnn.. TThhee sseeaarrcchh kkeeyy vvaalluueess aarree kkeepptt iinn ssoorrtteedd oorrddeerr.. 44 P1 K1 P2 Pn-1 Kn-1 Pn
  • 5. 55 The pointer Pi can point ttoo eeiitthheerr aa ffiillee rreeccoorrdd oorr aa bbuucckkeett ooff ppooiinntteerrss wwhhiicchh eeaacchh ppooiinntt ttoo aa ffiillee rreeccoorrdd.. lleeaaff nnooddee,, nn == 33 Brighton Downtown A 212 Brighton 750 A 101 Brighton 750 A 212 Brighton 750 ...
  • 6. 66 Each leaf can hhoolldd uupp ttoo nn 11 vvaalluueess aanndd mmuusstt ccoonnttaaiinn aatt lleeaasstt [[((nn 11)) // 22]] vvaalluueess.. NNoonnlleeaaff nnooddee ppooiinntteerrss ppooiinntt ttoo ttrreeee nnooddeess ((lleeaaff nnooddeess)).. NNoonnlleeaaff nnooddeess ccaann hhoolldd uupp ttoo nn ppooiinntteerrss aanndd mmuusstt hhoolldd aatt lleeaasstt [[nn//22]] ppooiinntteerrss.. ii..ee.. nn == 33 Perryridge Mianus Redwood Brighton Downtown Mianus Redwood Round Hill Perryridge
  • 7. 77 BB++ -- TTrreeee UUppddaatteess IInnsseerrttiioonn IIff tthhee nneeww nnooddee hhaass aa sseeaarrcchh kkeeyy tthhaatt aallrreeaaddyy eexxiissttss iinn aannootthheerr lleeaaff nnooddee,, tthheenn iitt aaddddss tthhee nneeww rreeccoorrdd ttoo tthhee ffiillee aanndd aa ppooiinntteerr ttoo tthhee bbuucckkeett ooff ppooiinntteerrss.. IIff tthhee sseeaarrcchh kkeeyy iiss ddiiffffeerreenntt ffrroomm aallll ootthheerrss,, iitt iiss iinnsseerrtteedd iinn oorrddeerr.. DDeelleettiioonn IItt rreemmoovveess tthhee sseeaarrcchh kkeeyy vvaalluuee ffrroomm tthhee nnooddee..
  • 8. 88 i.e. we are ggooiinngg ttoo iinnsseerrtt aa nnooddee wwiitthh aa sseeaarrcchh kkeeyy vvaalluuee CClleeaarrvviieeww.. WWee ffiinndd tthhaatt CClleeaarrvviieeww sshhoouulldd bbee iinn tthhee nnooddee wwiitthh BBrriigghhttoonn aanndd DDoowwnnttoowwnn,, ssoo wwee mmuusstt sspplliitt tthhee nnooddee.. ii..ee.. nn == 33 Perryridge Downtown Mianus Redwood Brighton Clearview Mianus Redwood Round Hill Perryridge Downtown
  • 9. 99 i.e. Deletion ooff DDoowwnnttoowwnn ffrroomm sslliiddee ##88.. Perryridge Mianus Redwood Brighton Clearview Mianus Redwood Round Hill Perryridge
  • 10. 1100 ii..ee.. DDeelleettiioonn ooff PPeerrrryyrriiddggee ffrroomm sslliiddee ##88 Mianus Downtown Redwood Brighton Clearview Mianus Redwood Round Hill Downtown
  • 11. BB++ -- TTrreeee FFiillee OOrrggaanniizzaattiioonn IInn aa BB++ -- TTrreeee ffiillee oorrggaanniizzaattiioonn,, tthhee lleeaaff nnooddeess ooff tthhee ttrreeee ssttoorreess tthhee aaccttuuaall rreeccoorrdd rraatthheerr tthhaann ssttoorriinngg ppooiinntteerrss ttoo rreeccoorrddss.. DDuurriinngg iinnsseerrttiioonn,, tthhee ssyysstteemm llooccaatteess tthhee bblloocckk tthhaatt sshhoouulldd ccoonnttaaiinn tthhee rreeccoorrdd.. IIff tthheerree iiss eennoouugghh ffrreeee ssppaaccee iinn tthhee nnooddee tthheenn tthhee ssyysstteemm ssttoorreess iitt.. OOtthheerrwwiissee tthhee ssyysstteemm sspplliittss tthhee rreeccoorrdd iinn ttwwoo aanndd ddiissttrriibbuutteess tthhee rreeccoorrddss.. DDuurriinngg ddeelleettiioonn,, tthhee ssyysstteemm ffiirrsstt rreemmoovveess tthhee rreeccoorrdd ffrroomm tthhee bblloocckk ccoonnttaaiinniinngg iitt.. IIff tthhee bblloocckk bbeeccoommeess lleessss tthhaann hhaallff ffuullll aass aa rreessuulltt,, tthhee rreeccoorrddss iinn tthhee bblloocckk aarree rreeddiissttrriibbuutteedd.. 1111
  • 12. 1122 BB++ -- TTrreeee FFiillee OOrrggaanniizzaattiioonn
  • 13. 1133 BB -- TTrreeee IInnddeexx FFiilleess Similar to B+-tree, but B-tree allows search-key values to appear only once; eliminates redundant storage of search keys. Search keys in nonleaf nodes appear nowhere else in the B-tree; an additional pointer field for each search key in a nonleaf node must be included. NNoonnlleeaaff nnooddee ppooiinntteerrss BBii aarree tthhee bbuucckkeett oorr ffiillee rreeccoorrdd ppooiinntteerrss..
  • 14. 1144 BB TTrreeee IInnddeexx FFiilleess AAddvvaannttaaggeess ooff BB--TTrreeee iinnddiicceess:: MMaayy uussee lleessss ttrreeee nnooddeess tthhaann aa ccoorrrreessppoonnddiinngg BB++--TTrreeee.. SSoommeettiimmeess ppoossssiibbllee ttoo ffiinndd sseeaarrcchh--kkeeyy vvaalluuee bbeeffoorree rreeaacchhiinngg lleeaaff nnooddee.. DDiissaaddvvaannttaaggeess ooff BB--TTrreeee iinnddiicceess:: OOnnllyy ssmmaallll ffrraaccttiioonn ooff aallll sseeaarrcchh--kkeeyy vvaalluueess aarree ffoouunndd eeaarrllyy NNoonn--lleeaaff nnooddeess aarree llaarrggeerr,, ssoo ffaann--oouutt iiss rreedduucceedd.. TThhuuss BB--TTrreeeess ttyyppiiccaallllyy hhaavvee ggrreeaatteerr ddeepptthh tthhaann ccoorrrreessppoonnddiinngg BB++--TTrreeee IInnsseerrttiioonn aanndd ddeelleettiioonn mmoorree ccoommpplliiccaatteedd tthhaann iinn BB++--TTrreeeess IImmpplleemmeennttaattiioonn iiss hhaarrddeerr tthhaann BB++--TTrreeeess..