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

Define sr flip flop - sr latch with nor gate, Define SR Flip Flop - SR latc...

Define SR Flip Flop - SR latch with NOR Gate? The SR Flip flop neither is a circuit with two cross-coupled NOR gates or two cross-coupled NAND gates. SR

What are the elements of an instruction, Q. What are the elements of an ins...

Q. What are the elements of an instruction? As the function of instruction is to communicate to CPU what to do it needs a minimum set of communication such as:  What op

What is meant by latch, Latch is a D- type flip-flop used as a temporary st...

Latch is a D- type flip-flop used as a temporary storage device controlled by a timing signal, which can kept 0 or 1. The primary function of a Latch is data storage. It is used in

What are the counters, What are the Counters? 1. The Counter is a seque...

What are the Counters? 1. The Counter is a sequential circuit which consists of a set of flip flops connected in a appropriate manner to count the sequence of input pulses.

What is a good resolution, Q. What is a good resolution? In fact it rel...

Q. What is a good resolution? In fact it relies on your hardware. Hence it's the maximum your hardware can allow you.  But one odd-looking resolution that has become popular is

Different search strategies- artificial intelligence, Different search stra...

Different search strategies- artificial intelligence: To help us think about the different search strategies, we use two analogies. Firstly, we suppose that the professor keep

What is presentation layer, Q. What is Presentation layer? Presentatio...

Q. What is Presentation layer? Presentation layer: When two hosts are communicating with each other they might use different coding standards and character sets for represent

Definition of a micro controllers, Before we take a detailed look about the...

Before we take a detailed look about the Motorola 68HC11 series of micro controllers it is useful to define what is meant by a micro controller. As the name suggests a micro contro

Describe the features of electronic banking, Question 1: The Banking Ac...

Question 1: The Banking Act provides for banking services through interactive electronic systems. (a) Describe the features of electronic banking. (b) Show the responsibi

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