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

What are the requirements for a swapper to work, What are the requirements ...

What are the requirements for a swapper to work? The swapper works on the highest scheduling priority. Firstly it will look for any sleeping method, if not found then it will

Same reg variable in an always block, What value is inferred when multiple ...

What value is inferred when multiple procedural assignments made to the same reg variable in an always block? When  there  are  multiple  nonblocking  assignments  made  to  th

Eliminating data hazards - computer architecture, Eliminating data hazards:...

Eliminating data hazards: Forwarding NOTE: In the following instance, computed values are in bold, whereas Register numbers are not. Forwarding involves adding output

How the system would work in real time- simulation, How the system would wo...

How the system would work in real time -  Sensors in/near road gather data (these can be infra-red/light sensors, pressure sensors, induction loops etc.) -data is generally num

Define the term internet, Internet:  The Internet, an umbrella term cov...

Internet:  The Internet, an umbrella term cover countless network and services that comprise a super-network, is a global network of computer networks that was started in the 1

Realize x-nor gate using nand gate, Q. A. Which gates are called Universa...

Q. A. Which gates are called Universal Gates? Why? B. State and prove any one of the DeMorgen's Laws. Show that these theorems can be extended up to any number of variables.

What are the different database integrities, What are the different databas...

What are the different database integrities? Semantic Integrity. Relational Integrity. Primary Key Integrity. Value Set Integrity. Foreign Key integrity and

Example of bitwise-and operator, Example of Bitwise-AND Operator In the...

Example of Bitwise-AND Operator In the following example, the bitwise-AND operator (&) compares the bits of two integers, nNumA and nNumB: // Example of the bitwise-AND oper

Write a program to input an address, Write a program to input an address i....

Write a program to input an address i.e. 20 Hex and read the byte (char) contents of that address   Answer   include void main() { char prompt; Date: 26th August 2012

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