Explain insertion procedure into a b-tree, Data Structure & Algorithms

Ans:

Insertion into the B-tree:

1.  First search is made for the place where the new record must be positioned. As soon as the keys are inserted, they are sorted into the appropriate order.

2.  If the node can contain the new record, insert the new record at the suitable pointer so that number of pointers happens to be one more than the number of records.

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

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

 

 

Posted Date: 7/11/2012 1:42:52 AM | Location : United States







Related Discussions:- Explain insertion procedure into a b-tree, Assignment Help, Ask Question on Explain insertion procedure into a b-tree, Get Answer, Expert's Help, Explain insertion procedure into a b-tree Discussions

Write discussion on Explain insertion procedure into a b-tree
Your posts are moderated
Related Questions
Q. Define the graph, adjacency matrix, adjacency list, hash function, adjacency matrix, sparse matrix, reachability matrix.

1. Apply the variant Breadth-First Search algorithm as shown in Figure 2 to the attached graph. This variant is used for computing the shortest distance to each vertex from the sta

how to implement prims algorithm dynamically

We have discussed that the above Dijkstra's single source shortest-path algorithm works for graphs along with non-negative edges (like road networks). Given two scenarios can emerg

The advantage of list over Arrays is flexibility. Over flood is not a problem until the computer memory is bushed. When the individual record are quite large, it may be difficult t

a) Find the shortest paths from r to all other nodes in the digraph G=(V,E) shown below using the Bellman-Ford algorithm (as taught in class). Please show your work, and draw the f

ESO207: Programming Assignment 1 Due on 6 Sept, 2015. To be submitted online. Problem In this assignment you are required to implement k-way Merge Sort algorithm. In this version p

Q. Convert the following given Infix expression to Postfix form using the stack function: x + y * z + ( p * q + r ) * s , Follow general precedence rule and suppose tha

Post order traversal: The children of node are visited before the node itself; the root is visited last. Each node is visited after its descendents are visited. Algorithm fo

You are given an undirected graph G = (V, E) in which the edge weights are highly restricted. In particular, each edge has a positive integer weight of either {1,2,...,W}, where W