SlideShare a Scribd company logo
1 of 11
Copyright Sunarya D. MarwahCopyright Sunarya D. Marwah
BAGIAN VIBAGIAN VI
Copyright Sunarya D. MarwahCopyright Sunarya D. Marwah
B-TreeB-Tree
B-tree merupakan gabungan antara
struktur linier dengan struktur tree,
dengan jumlah anak tidak terbatas
(walaupun ada batas praktis),
sehingga sesuai untuk menampung
data (target data / key) yang sangat
banyak.
Copyright Sunarya D. MarwahCopyright Sunarya D. Marwah
B-TreeB-Tree
Karakteristik B-tree
1. Node atau sering juga disebut Page, dapat berisi
lebih dari satu elemen.
2. Jumlah elemen didalam page menunjukan orde
B-tree, dengan notasi d.
3. Jumlah minimum elemen didalam page, kecuali
root page adalah d.
4. Jumlah maksimum elemen dalam page adalah
2d.
5. Jumlah anak: 0 ≤ anak ≤ 2d + 1
6. Seluruh Leaf page berada dalam satu level.
Copyright Sunarya D. MarwahCopyright Sunarya D. Marwah
B-TreeB-Tree
Insert
Misalkan B-tree dirancang dengan orde d = 2.
Urutan data yang masuk: 12 24 25 19 20
Insert(12):
Insert(24):
Insert(25):
Insert(19):
12
12 24
12 24 25
12 19 24 25
Copyright Sunarya D. MarwahCopyright Sunarya D. Marwah
B-TreeB-Tree
Insert(20), menyebabkan page overflow, karena page
berisi 2d + 1 sehingga page perlu split (memecah
diri) menjadi dua bagian, dengan aturan sebagai
berukut:
a. Satu dengan nilai tengah naik ke parent page,
bila parent page tidak ada maka dibuat parent
baru.
b. Dua elemen yang nilainya lebih kecil dari elemen
tengah, masuk ke page kiri.
c. Dua elemen yang nilainya lebih besar dari elemen
tengah, masuk ke page kanan
Copyright Sunarya D. MarwahCopyright Sunarya D. Marwah
B-TreeB-Tree
Page Split
12 19 24 25
20
(12 dan 19) < 20 (24 dan 25) > 20
20 naik keatas
Copyright Sunarya D. MarwahCopyright Sunarya D. Marwah
B-TreeB-Tree
Text
Copyright Sunarya D. MarwahCopyright Sunarya D. Marwah
B-TreeB-Tree
Text
Copyright Sunarya D. MarwahCopyright Sunarya D. Marwah
B-TreeB-Tree
Text
Copyright Sunarya D. MarwahCopyright Sunarya D. Marwah
B-TreeB-Tree
Text
Copyright Sunarya D. MarwahCopyright Sunarya D. Marwah
B-TreeB-Tree
Text

More Related Content

Featured

How Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental HealthHow Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental Health
ThinkNow
 
Social Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsSocial Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie Insights
Kurio // The Social Media Age(ncy)
 

Featured (20)

2024 State of Marketing Report – by Hubspot
2024 State of Marketing Report – by Hubspot2024 State of Marketing Report – by Hubspot
2024 State of Marketing Report – by Hubspot
 
Everything You Need To Know About ChatGPT
Everything You Need To Know About ChatGPTEverything You Need To Know About ChatGPT
Everything You Need To Know About ChatGPT
 
Product Design Trends in 2024 | Teenage Engineerings
Product Design Trends in 2024 | Teenage EngineeringsProduct Design Trends in 2024 | Teenage Engineerings
Product Design Trends in 2024 | Teenage Engineerings
 
How Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental HealthHow Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental Health
 
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdfAI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
 
Skeleton Culture Code
Skeleton Culture CodeSkeleton Culture Code
Skeleton Culture Code
 
PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024
 
Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)
 
How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024
 
Social Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsSocial Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie Insights
 
Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024
 
5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary
 
ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd
 
Getting into the tech field. what next
Getting into the tech field. what next Getting into the tech field. what next
Getting into the tech field. what next
 
Google's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search IntentGoogle's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search Intent
 
How to have difficult conversations
How to have difficult conversations How to have difficult conversations
How to have difficult conversations
 
Introduction to Data Science
Introduction to Data ScienceIntroduction to Data Science
Introduction to Data Science
 
Time Management & Productivity - Best Practices
Time Management & Productivity -  Best PracticesTime Management & Productivity -  Best Practices
Time Management & Productivity - Best Practices
 
The six step guide to practical project management
The six step guide to practical project managementThe six step guide to practical project management
The six step guide to practical project management
 
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
 

Struktur data 07 (b tree)

  • 1. Copyright Sunarya D. MarwahCopyright Sunarya D. Marwah BAGIAN VIBAGIAN VI
  • 2. Copyright Sunarya D. MarwahCopyright Sunarya D. Marwah B-TreeB-Tree B-tree merupakan gabungan antara struktur linier dengan struktur tree, dengan jumlah anak tidak terbatas (walaupun ada batas praktis), sehingga sesuai untuk menampung data (target data / key) yang sangat banyak.
  • 3. Copyright Sunarya D. MarwahCopyright Sunarya D. Marwah B-TreeB-Tree Karakteristik B-tree 1. Node atau sering juga disebut Page, dapat berisi lebih dari satu elemen. 2. Jumlah elemen didalam page menunjukan orde B-tree, dengan notasi d. 3. Jumlah minimum elemen didalam page, kecuali root page adalah d. 4. Jumlah maksimum elemen dalam page adalah 2d. 5. Jumlah anak: 0 ≤ anak ≤ 2d + 1 6. Seluruh Leaf page berada dalam satu level.
  • 4. Copyright Sunarya D. MarwahCopyright Sunarya D. Marwah B-TreeB-Tree Insert Misalkan B-tree dirancang dengan orde d = 2. Urutan data yang masuk: 12 24 25 19 20 Insert(12): Insert(24): Insert(25): Insert(19): 12 12 24 12 24 25 12 19 24 25
  • 5. Copyright Sunarya D. MarwahCopyright Sunarya D. Marwah B-TreeB-Tree Insert(20), menyebabkan page overflow, karena page berisi 2d + 1 sehingga page perlu split (memecah diri) menjadi dua bagian, dengan aturan sebagai berukut: a. Satu dengan nilai tengah naik ke parent page, bila parent page tidak ada maka dibuat parent baru. b. Dua elemen yang nilainya lebih kecil dari elemen tengah, masuk ke page kiri. c. Dua elemen yang nilainya lebih besar dari elemen tengah, masuk ke page kanan
  • 6. Copyright Sunarya D. MarwahCopyright Sunarya D. Marwah B-TreeB-Tree Page Split 12 19 24 25 20 (12 dan 19) < 20 (24 dan 25) > 20 20 naik keatas
  • 7. Copyright Sunarya D. MarwahCopyright Sunarya D. Marwah B-TreeB-Tree Text
  • 8. Copyright Sunarya D. MarwahCopyright Sunarya D. Marwah B-TreeB-Tree Text
  • 9. Copyright Sunarya D. MarwahCopyright Sunarya D. Marwah B-TreeB-Tree Text
  • 10. Copyright Sunarya D. MarwahCopyright Sunarya D. Marwah B-TreeB-Tree Text
  • 11. Copyright Sunarya D. MarwahCopyright Sunarya D. Marwah B-TreeB-Tree Text