SlideShare a Scribd company logo
1 of 15
..B-TREEB-TREE
• A B-TREE IS A TREE SATISFYING THE FOLLOWING PROPERTIES.A B-TREE IS A TREE SATISFYING THE FOLLOWING PROPERTIES.
1.1. EVERY NODE CONTAINS THE FOLLOWING FIELDSEVERY NODE CONTAINS THE FOLLOWING FIELDS
a.a. AN ARRAY TO HOLD THE KEY VALUESAN ARRAY TO HOLD THE KEY VALUES
b.b. A DATA ARRAY TO HOLD THE ASSOCIATED DATA VALUESA DATA ARRAY TO HOLD THE ASSOCIATED DATA VALUES
c.c. A POINTER ARRAY TO POINT TO THE CHILD NODESA POINTER ARRAY TO POINT TO THE CHILD NODES
d.d. THE NUMBER OF KEYS THAT IS CURRENTLY STORED, NTHE NUMBER OF KEYS THAT IS CURRENTLY STORED, N
e.e. A BOOLEAN VARIABLE TO INDICATE WHETHER THE NODEA BOOLEAN VARIABLE TO INDICATE WHETHER THE NODE
IS A LEAF NODE OR AN INTERNAL NODEIS A LEAF NODE OR AN INTERNAL NODE
2.2. EVERY NODE CAN STORE AT MOST 2*MD-1 NUMBER OF KEYSEVERY NODE CAN STORE AT MOST 2*MD-1 NUMBER OF KEYS
WHERE MD IS THE MINIMUM DEGREE OF THE B-TREE.WHERE MD IS THE MINIMUM DEGREE OF THE B-TREE.
3.3. EVERY NODE EXCEPT ROOT MUST CONTAIN AT LEAST MD NUMBEREVERY NODE EXCEPT ROOT MUST CONTAIN AT LEAST MD NUMBER
OF KEYS.OF KEYS.
4.4. THE KEYS ARE STORED IN SORTED ORDER WITHIN A NODE AND ITTHE KEYS ARE STORED IN SORTED ORDER WITHIN A NODE AND IT
SEPARATES THE KEY VALUES THAT ARE STORED IN THESEPARATES THE KEY VALUES THAT ARE STORED IN THE
CORRESPONDING SUBTREE.CORRESPONDING SUBTREE.
5.5. ALL THE LEAF NODES ARE IN THE SAME DEPTH FROM THE ROOT.ALL THE LEAF NODES ARE IN THE SAME DEPTH FROM THE ROOT.
45
insert 45
insert 22
insert 90
insert 4
insert 77
insert 34
insert 37
insert 65
insert 45
insert 95
insert 23
insert 77
insert 33
insert 66
insert 29
22 45
insert 45
insert 22
insert 90
insert 4
insert 77
insert 34
insert 37
insert 65
insert 45
insert 95
insert 23
insert 77
insert 33
insert 66
insert 29
22 45 90
insert 45
insert 22
insert 90
insert 4
insert 77
insert 34
insert 37
insert 65
insert 45
insert 95
insert 23
insert 77
insert 33
insert 66
insert 29
45
insert 45
insert 22
insert 90
insert 4
insert 77
insert 34
insert 37
insert 65
insert 45
insert 95
insert 23
insert 77
insert 33
insert 66
insert 29
4 22 90
45
insert 45
insert 22
insert 90
insert 4
insert 77
insert 34
insert 37
insert 65
insert 45
insert 95
insert 23
insert 77
insert 33
insert 66
insert 29
4 22 77 90
45
insert 45
insert 22
insert 90
insert 4
insert 77
insert 34
insert 37
insert 65
insert 45
insert 95
insert 23
insert 77
insert 33
insert 66
insert 29
4 22 34 77 90
22 45
insert 45
insert 22
insert 90
insert 4
insert 77
insert 34
insert 37
insert 65
insert 45
insert 95
insert 23
insert 77
insert 33
insert 66
insert 29
4 77 9034 37
22 45
insert 45
insert 22
insert 90
insert 4
insert 77
insert 34
insert 37
insert 65
insert 45
insert 95
insert 23
insert 77
insert 33
insert 66
insert 29
4 65 77 9034 37
22 45
insert 45
insert 22
insert 90
insert 4
insert 77
insert 34
insert 37
insert 65
insert 45
insert 95
insert 23
insert 77
insert 33
insert 66
insert 29
4 65 77 9034 37
Key 45 already exists
22 45 77
insert 45
insert 22
insert 90
insert 4
insert 77
insert 34
insert 37
insert 65
insert 45
insert 95
insert 23
insert 77
insert 33
insert 66
insert 29
4 6534 37 90 95
22
insert 45
insert 22
insert 90
insert 4
insert 77
insert 34
insert 37
insert 65
insert 45
insert 95
insert 23
insert 77
insert 33
insert 66
insert 29
4 6523 34 37 90 95
77
45
22
insert 45
insert 22
insert 90
insert 4
insert 77
insert 34
insert 37
insert 65
insert 45
insert 95
insert 23
insert 77
insert 33
insert 66
insert 29
4 6523 34 37 90 95
77
45
Key 77 already exists
22 34
insert 45
insert 22
insert 90
insert 4
insert 77
insert 34
insert 37
insert 65
insert 45
insert 95
insert 23
insert 77
insert 33
insert 66
insert 29
4 6523 33 90 95
77
45
37

More Related Content

Viewers also liked

문제는 한글이 잘 구현되는가?
문제는 한글이 잘 구현되는가?문제는 한글이 잘 구현되는가?
문제는 한글이 잘 구현되는가?Choi Man Dream
 
nhận thiết kế clip quảng cáo giá tốt
nhận thiết kế clip quảng cáo giá tốtnhận thiết kế clip quảng cáo giá tốt
nhận thiết kế clip quảng cáo giá tốtraul110
 
5.4 randamized algorithm
5.4 randamized algorithm5.4 randamized algorithm
5.4 randamized algorithmKrish_ver2
 
trabajo de cultural
trabajo de culturaltrabajo de cultural
trabajo de culturalargelures
 
2.4 mst kruskal’s
2.4 mst  kruskal’s 2.4 mst  kruskal’s
2.4 mst kruskal’s Krish_ver2
 
5.2 divede and conquer 03
5.2 divede and conquer 035.2 divede and conquer 03
5.2 divede and conquer 03Krish_ver2
 
5.4 randomized datastructures
5.4 randomized datastructures5.4 randomized datastructures
5.4 randomized datastructuresKrish_ver2
 
Madhumita Project Coordinator/Business Analyst
Madhumita Project Coordinator/Business AnalystMadhumita Project Coordinator/Business Analyst
Madhumita Project Coordinator/Business AnalystMadhumita Bairagi
 
5.1 greedyyy 02
5.1 greedyyy 025.1 greedyyy 02
5.1 greedyyy 02Krish_ver2
 
2.6 all pairsshortestpath
2.6 all pairsshortestpath2.6 all pairsshortestpath
2.6 all pairsshortestpathKrish_ver2
 
Madhumita Project Coordinator/Business Analyst
Madhumita Project Coordinator/Business AnalystMadhumita Project Coordinator/Business Analyst
Madhumita Project Coordinator/Business AnalystMadhumita Bairagi
 

Viewers also liked (18)

4.2 bst 02
4.2 bst 024.2 bst 02
4.2 bst 02
 
4.2 bst 03
4.2 bst 034.2 bst 03
4.2 bst 03
 
RESUME-ARITRA BHOWMIK
RESUME-ARITRA BHOWMIKRESUME-ARITRA BHOWMIK
RESUME-ARITRA BHOWMIK
 
문제는 한글이 잘 구현되는가?
문제는 한글이 잘 구현되는가?문제는 한글이 잘 구현되는가?
문제는 한글이 잘 구현되는가?
 
nhận thiết kế clip quảng cáo giá tốt
nhận thiết kế clip quảng cáo giá tốtnhận thiết kế clip quảng cáo giá tốt
nhận thiết kế clip quảng cáo giá tốt
 
4.4 hashing02
4.4 hashing024.4 hashing02
4.4 hashing02
 
5.4 randamized algorithm
5.4 randamized algorithm5.4 randamized algorithm
5.4 randamized algorithm
 
4.1 webminig
4.1 webminig 4.1 webminig
4.1 webminig
 
trabajo de cultural
trabajo de culturaltrabajo de cultural
trabajo de cultural
 
2.4 mst kruskal’s
2.4 mst  kruskal’s 2.4 mst  kruskal’s
2.4 mst kruskal’s
 
5.2 divede and conquer 03
5.2 divede and conquer 035.2 divede and conquer 03
5.2 divede and conquer 03
 
Top Forex Brokers
Top Forex BrokersTop Forex Brokers
Top Forex Brokers
 
Online Trading Concepts
Online Trading ConceptsOnline Trading Concepts
Online Trading Concepts
 
5.4 randomized datastructures
5.4 randomized datastructures5.4 randomized datastructures
5.4 randomized datastructures
 
Madhumita Project Coordinator/Business Analyst
Madhumita Project Coordinator/Business AnalystMadhumita Project Coordinator/Business Analyst
Madhumita Project Coordinator/Business Analyst
 
5.1 greedyyy 02
5.1 greedyyy 025.1 greedyyy 02
5.1 greedyyy 02
 
2.6 all pairsshortestpath
2.6 all pairsshortestpath2.6 all pairsshortestpath
2.6 all pairsshortestpath
 
Madhumita Project Coordinator/Business Analyst
Madhumita Project Coordinator/Business AnalystMadhumita Project Coordinator/Business Analyst
Madhumita Project Coordinator/Business Analyst
 

More from Krish_ver2

5.5 back tracking
5.5 back tracking5.5 back tracking
5.5 back trackingKrish_ver2
 
5.5 back track
5.5 back track5.5 back track
5.5 back trackKrish_ver2
 
5.5 back tracking 02
5.5 back tracking 025.5 back tracking 02
5.5 back tracking 02Krish_ver2
 
5.4 randomized datastructures
5.4 randomized datastructures5.4 randomized datastructures
5.4 randomized datastructuresKrish_ver2
 
5.3 dynamic programming 03
5.3 dynamic programming 035.3 dynamic programming 03
5.3 dynamic programming 03Krish_ver2
 
5.3 dynamic programming
5.3 dynamic programming5.3 dynamic programming
5.3 dynamic programmingKrish_ver2
 
5.2 divede and conquer 03
5.2 divede and conquer 035.2 divede and conquer 03
5.2 divede and conquer 03Krish_ver2
 
5.2 divide and conquer
5.2 divide and conquer5.2 divide and conquer
5.2 divide and conquerKrish_ver2
 
4.4 hashing ext
4.4 hashing  ext4.4 hashing  ext
4.4 hashing extKrish_ver2
 
4.4 external hashing
4.4 external hashing4.4 external hashing
4.4 external hashingKrish_ver2
 
4.1 sequentioal search
4.1 sequentioal search4.1 sequentioal search
4.1 sequentioal searchKrish_ver2
 
3.9 external sorting
3.9 external sorting3.9 external sorting
3.9 external sortingKrish_ver2
 
3.8 quick sort
3.8 quick sort3.8 quick sort
3.8 quick sortKrish_ver2
 
3.8 quicksort 04
3.8 quicksort 043.8 quicksort 04
3.8 quicksort 04Krish_ver2
 

More from Krish_ver2 (20)

5.5 back tracking
5.5 back tracking5.5 back tracking
5.5 back tracking
 
5.5 back track
5.5 back track5.5 back track
5.5 back track
 
5.5 back tracking 02
5.5 back tracking 025.5 back tracking 02
5.5 back tracking 02
 
5.4 randomized datastructures
5.4 randomized datastructures5.4 randomized datastructures
5.4 randomized datastructures
 
5.3 dynamic programming 03
5.3 dynamic programming 035.3 dynamic programming 03
5.3 dynamic programming 03
 
5.3 dynamic programming
5.3 dynamic programming5.3 dynamic programming
5.3 dynamic programming
 
5.2 divede and conquer 03
5.2 divede and conquer 035.2 divede and conquer 03
5.2 divede and conquer 03
 
5.2 divide and conquer
5.2 divide and conquer5.2 divide and conquer
5.2 divide and conquer
 
5.1 greedy
5.1 greedy5.1 greedy
5.1 greedy
 
5.1 greedy 03
5.1 greedy 035.1 greedy 03
5.1 greedy 03
 
4.4 hashing
4.4 hashing4.4 hashing
4.4 hashing
 
4.4 hashing ext
4.4 hashing  ext4.4 hashing  ext
4.4 hashing ext
 
4.4 external hashing
4.4 external hashing4.4 external hashing
4.4 external hashing
 
4.2 bst
4.2 bst4.2 bst
4.2 bst
 
4.1 sequentioal search
4.1 sequentioal search4.1 sequentioal search
4.1 sequentioal search
 
3.9 external sorting
3.9 external sorting3.9 external sorting
3.9 external sorting
 
3.8 quicksort
3.8 quicksort3.8 quicksort
3.8 quicksort
 
3.8 quick sort
3.8 quick sort3.8 quick sort
3.8 quick sort
 
3.8 quicksort 04
3.8 quicksort 043.8 quicksort 04
3.8 quicksort 04
 
3.7 heap sort
3.7 heap sort3.7 heap sort
3.7 heap sort
 

1.9 b trees 02

  • 2. • A B-TREE IS A TREE SATISFYING THE FOLLOWING PROPERTIES.A B-TREE IS A TREE SATISFYING THE FOLLOWING PROPERTIES. 1.1. EVERY NODE CONTAINS THE FOLLOWING FIELDSEVERY NODE CONTAINS THE FOLLOWING FIELDS a.a. AN ARRAY TO HOLD THE KEY VALUESAN ARRAY TO HOLD THE KEY VALUES b.b. A DATA ARRAY TO HOLD THE ASSOCIATED DATA VALUESA DATA ARRAY TO HOLD THE ASSOCIATED DATA VALUES c.c. A POINTER ARRAY TO POINT TO THE CHILD NODESA POINTER ARRAY TO POINT TO THE CHILD NODES d.d. THE NUMBER OF KEYS THAT IS CURRENTLY STORED, NTHE NUMBER OF KEYS THAT IS CURRENTLY STORED, N e.e. A BOOLEAN VARIABLE TO INDICATE WHETHER THE NODEA BOOLEAN VARIABLE TO INDICATE WHETHER THE NODE IS A LEAF NODE OR AN INTERNAL NODEIS A LEAF NODE OR AN INTERNAL NODE 2.2. EVERY NODE CAN STORE AT MOST 2*MD-1 NUMBER OF KEYSEVERY NODE CAN STORE AT MOST 2*MD-1 NUMBER OF KEYS WHERE MD IS THE MINIMUM DEGREE OF THE B-TREE.WHERE MD IS THE MINIMUM DEGREE OF THE B-TREE. 3.3. EVERY NODE EXCEPT ROOT MUST CONTAIN AT LEAST MD NUMBEREVERY NODE EXCEPT ROOT MUST CONTAIN AT LEAST MD NUMBER OF KEYS.OF KEYS. 4.4. THE KEYS ARE STORED IN SORTED ORDER WITHIN A NODE AND ITTHE KEYS ARE STORED IN SORTED ORDER WITHIN A NODE AND IT SEPARATES THE KEY VALUES THAT ARE STORED IN THESEPARATES THE KEY VALUES THAT ARE STORED IN THE CORRESPONDING SUBTREE.CORRESPONDING SUBTREE. 5.5. ALL THE LEAF NODES ARE IN THE SAME DEPTH FROM THE ROOT.ALL THE LEAF NODES ARE IN THE SAME DEPTH FROM THE ROOT.
  • 3. 45 insert 45 insert 22 insert 90 insert 4 insert 77 insert 34 insert 37 insert 65 insert 45 insert 95 insert 23 insert 77 insert 33 insert 66 insert 29
  • 4. 22 45 insert 45 insert 22 insert 90 insert 4 insert 77 insert 34 insert 37 insert 65 insert 45 insert 95 insert 23 insert 77 insert 33 insert 66 insert 29
  • 5. 22 45 90 insert 45 insert 22 insert 90 insert 4 insert 77 insert 34 insert 37 insert 65 insert 45 insert 95 insert 23 insert 77 insert 33 insert 66 insert 29
  • 6. 45 insert 45 insert 22 insert 90 insert 4 insert 77 insert 34 insert 37 insert 65 insert 45 insert 95 insert 23 insert 77 insert 33 insert 66 insert 29 4 22 90
  • 7. 45 insert 45 insert 22 insert 90 insert 4 insert 77 insert 34 insert 37 insert 65 insert 45 insert 95 insert 23 insert 77 insert 33 insert 66 insert 29 4 22 77 90
  • 8. 45 insert 45 insert 22 insert 90 insert 4 insert 77 insert 34 insert 37 insert 65 insert 45 insert 95 insert 23 insert 77 insert 33 insert 66 insert 29 4 22 34 77 90
  • 9. 22 45 insert 45 insert 22 insert 90 insert 4 insert 77 insert 34 insert 37 insert 65 insert 45 insert 95 insert 23 insert 77 insert 33 insert 66 insert 29 4 77 9034 37
  • 10. 22 45 insert 45 insert 22 insert 90 insert 4 insert 77 insert 34 insert 37 insert 65 insert 45 insert 95 insert 23 insert 77 insert 33 insert 66 insert 29 4 65 77 9034 37
  • 11. 22 45 insert 45 insert 22 insert 90 insert 4 insert 77 insert 34 insert 37 insert 65 insert 45 insert 95 insert 23 insert 77 insert 33 insert 66 insert 29 4 65 77 9034 37 Key 45 already exists
  • 12. 22 45 77 insert 45 insert 22 insert 90 insert 4 insert 77 insert 34 insert 37 insert 65 insert 45 insert 95 insert 23 insert 77 insert 33 insert 66 insert 29 4 6534 37 90 95
  • 13. 22 insert 45 insert 22 insert 90 insert 4 insert 77 insert 34 insert 37 insert 65 insert 45 insert 95 insert 23 insert 77 insert 33 insert 66 insert 29 4 6523 34 37 90 95 77 45
  • 14. 22 insert 45 insert 22 insert 90 insert 4 insert 77 insert 34 insert 37 insert 65 insert 45 insert 95 insert 23 insert 77 insert 33 insert 66 insert 29 4 6523 34 37 90 95 77 45 Key 77 already exists
  • 15. 22 34 insert 45 insert 22 insert 90 insert 4 insert 77 insert 34 insert 37 insert 65 insert 45 insert 95 insert 23 insert 77 insert 33 insert 66 insert 29 4 6523 33 90 95 77 45 37