The Gateway to Computer Science Excellence
First time here? Checkout the FAQ!
x
+6 votes
652 views

We wish to construct a $B^+$ tree with fan-out (the number of pointers per node) equal to 3 for the following set of key values:

80, 50, 10, 70, 30, 100, 90

Assume that the tree is initially empty and the values are added in the order given.

  1. Show the tree after insertion of 10, after insertion of 30, and after insertion of 90. Intermediate trees need not be shown.
  2. The key values 30 and 10 are now deleted from the tree in that order show the tree after each deletion.
asked in Databases by Veteran (59.7k points)
edited by | 652 views
0
fanout means no of records per node but b+ trees contain an additional pointer pointing to next node so in this case would splitting will take place after insertion of 2 key values or 3 key values? Plz explain...
0
After 2 key values. Also, that additional pointer appears only in leaves.
0
why split after 2 key value ??

since order = 3, so we can have 2 key elements in a node with no problem but when we have 3 key then it should be a overflow right ??
0
plz explain this one....
0
Same like btree

2 Answers

0 votes
Please explain this
answered by (73 points)
0 votes

in the B+ tree order of internal node and order of leaf node are different 

order of internal node is maximum no of childrens 

order of leaf node is maximum no of key value pair in the leaf 

in the question it is given that 

B+ tree with fan-out (the number of pointers per node) equal to 3

so from this we can easily conclude that the order of internal node is 3

and order of leaf node is 2   ( just think about it why it is 2 ?? you will get the answer )

for internal node 

since order = 3, so we can have 2 key elements in a node this is  not problem but when we have 3 key then we have to split them

for leaf node

since order = 2, so we can have 2 key elements in a node with no problem but when we have 3 key then we have to split them

 

 ( just think about it why it is 2 ??

it is because given fan-out (the number of pointers per node) equal to 3 

one pointer point to next leaf and two pointer point to the record means there are maximum  two record pointer 

and order of leaf node is  maximum number of key value pair 

so it is 2

answered by Active (5.2k points)

Related questions



Quick search syntax
tags tag:apple
author user:martin
title title:apple
content content:apple
exclude -tag:apple
force match +apple
views views:100
score score:10
answers answers:2
is accepted isaccepted:true
is closed isclosed:true

44,317 questions
49,814 answers
164,560 comments
65,867 users