Describe a search algorithm for a B + tree in which the search key is not a candidate key. Assume that over?ow pages are not used to handle duplicates.
What will be an ideal response?
Descend through the tree using the target key value, k0. At each level (including leaf) multiple entries in the page can contain the same key value — that is ki = ki+1 = . . . = k1+r.
• case 1: If ki +r< k0< ki +r +1 then follow pi +r.
• case 2: If ki ?1? k0< ki then follow pi ?1
• case 3: If k0= ki then follow pi ?1
![14808|581x557](upload://zVVGe1f1bjwKtgCIgRgbKXfWYdP.png)
When the leaf level is reached, scan forward using sibling pointers until a key, k ,is reached such that k > k0.
You might also like to view...
You can hold down the Ctrl key to select multiple items in a document
Indicate whether the statement is true or false
Before placing a tab on the ruler, you can select a tab type by clicking the tab button, which is located ________
A) on the HOME tab B) to the right of the horizontal ruler C) at the bottom of the vertical ruler D) to the left of the horizontal ruler