Algorithm to insert a key in b-tree, Computer Engineering

Assignment Help:

Algorithm to insert a key in B-tree is as follows:

1.  First search is completed for the place where the new record must be put. As the keys are inserted, they are sorted into the proper order.

2.  If the node can contain the new record, insert the new record at the appropriate pointer so that number of pointers remains one more than the number of records.

3.  If the node overflows due to there is an upper bound on the size of a node, splitting is needed. The node is divided into three parts; the middle record is passed upward and inserted into parent, leaving two children behind. If n is odd (n-1 keys in full node and the new target key), median key int(n/2)+1 is placed in parent node, the lower n/2 keys are put in the left leaf and the higher n/2 keys are put in the right leaf. If n is even, we might be have left biased or right biased means one key may be more in left child or right child correspondingly.

4.  Splitting may propagate up the tree because the parent, into which divided record is added, may overflow then it may be split.  If the root is needed to be split, a new record is formed with just two children.

 


Related Discussions:- Algorithm to insert a key in b-tree

Explain the working of light pens, Explain the working of light pens Li...

Explain the working of light pens Light pens still exist, but due to several disadvantages they are not as popular as other input devices that have been developed. For example,

What are the types of pipeline hazards, What are the types of pipeline haza...

What are the types of pipeline hazards? The various pipeline hazards are:  1. Data hazard  2. Structural Hazard  3. Control Hazard.

Determine the decimal equivalent of hexadecimal number, The hexadecimal num...

The hexadecimal number for (95.5) 10 is ? Ans. (95.5) 10 = (5F.8) 16 Integer part Fractional part 0.5x16=8.0

What are the advantages of using xml over html, What are the advantages of ...

What are the advantages of using XML over HTML? The root cause of the problem lies within HTML that is Hyper Text Markup Language, the defector standard for web publication. Th

What is the difference among save and save as, Use SAVE when you are revisi...

Use SAVE when you are revising an existing document. Use SAVE AS when you are making a new document from scratch or an existing document. This will remain the original document

Computers and cntrol, Define open and closed loop cotrol systems.Explain di...

Define open and closed loop cotrol systems.Explain difference between time varying and time invariant control system wth suitable example

Table - tr and td tags, Table, TR and TD Tags Three tags form the essen...

Table, TR and TD Tags Three tags form the essential ingredients for creating a table. TABLE: This is the main tag. It tells the browser that a table follows. It has attrib

What is the task of the pass 2 in a two-pass assembler, In a two-pass assem...

In a two-pass assembler, the task of the Pass II is to? Ans. The task of the Pass II is to synthesize the target program in a two-pass assembler.

Networking, compare 2g , 3g , and 4g also with advantage of 3g and 4g.

compare 2g , 3g , and 4g also with advantage of 3g and 4g.

What are two methods of modifying sap standard tables, What are two methods...

What are two methods of modifying SAP standard tables? Append Structures and Customizing Includes.

Write Your Message!

Captcha
Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd