Ask Question, Ask an Expert

+61-413 786 465

info@mywordsolution.com

Ask Computer Engineering Expert

Operations on B-Trees

Given are various operations which can be performed on B-Trees:

  • Search
  • Create
  • Insert

B-Tree does effort to minimize disk access and the nodes are usually stored on disk

All the nodes are supposed to be stored into secondary storage instead of primary storage. All references to a given node are preceded through a read operation. Likewise, once a node is changed and it is no longer required, it has to be written out to secondary storage with write operation.

Given is the algorithm for searching a B-tree:

B-Tree Search (x, k)

i < - 1

while i < = n [x] and k > keyi[x]

do i ← i + 1

if i < = n [x] and k = key1 [x]

then return (x, i)

if leaf [x]

then return NIL

else Disk - Read (ci[x])

return B - Tree Search (Ci[x], k)

The search operation is alike to binary tree. Instead of selecting between a left and right child as in binary tree, a B-tree search have to make an n-way choice.

The right child is selected by performing a linear search of the values into the node. After determining the value greater than or equal to desired value, the child pointer to the instantaneous left to that value is followed.

The exact running time of search operation based upon the height of the tree. Given is the algorithm for the creation of a B-tree:

B-Tree Create (T)

x ← Allocate-Node ( )

 Leaf [x] ← True

n [x] ← 0

Disk-write (x)

root [T] ← x

 

The above denoted algorithm creates an empty B-tree through allocating a new root which has no keys and is a leaf node.

Given is the algorithm for insertion into a B-tree:

B-Tree Insert (T,K)

r ← root (T)

if n[r] = 2t - 1

then S ← Allocate-Node ( )

root[T] ← S

leaf [S] ← FALSE

n[S] ← 0

C1 ← r

B-Tree-Split-Child (s, I, r)

B-Tree-Insert-Non full (s, k)

else

B - Tree-Insert-Non full (r, k)

To carry on an insertion on B-tree, the proper node for the key has to be located. Next, the key has to be inserted into the node.

If the node is not full prior to the insertion, then no special action is needed.

If node is full, then the node has to be split to make room for the new key. As splitting the node results in moving one key to the parent node, the parent node ha not be full. Else, another split operation is required.

This procedure may repeat all the way up to the root and may need splitting the root node.

Computer Engineering, Engineering

  • Category:- Computer Engineering
  • Reference No.:- M9536893

Have any Question?


Related Questions in Computer Engineering

Questions 1 what are the four parts of the administrative

Questions: 1. What are the four parts of the administrative simplification requirements of HIPAA? 2. Name three factors used to determine whether you need to comply with HIPAA. 3. What are the three categories of entitie ...

Could you help me to solve the following stats problemthe

Could you help me to solve the following stats problem? The number of patients waiting for flu vaccine at A hospital has the following probability distributions. x 1 2 3 4 p(x) 0.2 0.3 0.4 0.1 What is the variance of num ...

Question what specific benefits does the ebk provide to any

Question : What specific benefits does the EBK provide to any organization? Why are those particular benefits important to the overall organization? Specifically, what is it about the EBK that makes it particularly usefu ...

Select three interfaces and consider how the teamwork

select three interfaces, and consider how the teamwork application could be redesigned for each of these types. Use your imagination. How about using a tangible interface or even a drone to help remote students collabora ...

Question suppose we carry out a binary search of an ordered

Question : Suppose we carry out a binary search of an ordered list of 63 items: We are searching for an item X which occurs exactly once in the list. How many comparisons are carried out i. in the worst case scenario ii. ...

Answer the following question what is the relationship

Answer the following Question : What is the relationship between a role and a competency? How do roles facilitate the development and implementation of specific practices for any organization? The response must be typed, ...

Recall that a k-ary tree is a rooted tree where each node

Recall that a k-ary tree is a rooted tree where each node has up to k children (for some positive integer k). (a) Write a recursive definition of a nonempty A-ary tree with height h greaterthanorequalto 0. (b) A complete ...

Question need two different postsresponses with 200 words

Question: Need two different posts(responses) with 200 words each on the below topic. Read Four (4) academically reviewed articles on Cyber Security and Risk Management and complete the following activities:(Wikipedia ar ...

Recall that for a block cipher a key schedule algorithm

Recall that for a block cipher, a key schedule algorithm determines the subkey for each round, based on the key K. Let K = (K0,K1,K2......K55) be a 56-bit DES key. a. List the 48 bits for each of the 16 DES subkeys K1, K ...

Question research and provide a write up on available

Question : Research and provide a write up on available routers and switches. The report should include information for at least two router and two switching devices. Included in the write-up should be a description of t ...

  • 4,153,160 Questions Asked
  • 13,132 Experts
  • 2,558,936 Questions Answered

Ask Experts for help!!

Looking for Assignment Help?

Start excelling in your Courses, Get help with Assignment

Write us your full requirement for evaluation and you will receive response within 20 minutes turnaround time.

Ask Now Help with Problems, Get a Best Answer

Why might a bank avoid the use of interest rate swaps even

Why might a bank avoid the use of interest rate swaps, even when the institution is exposed to significant interest rate

Describe the difference between zero coupon bonds and

Describe the difference between zero coupon bonds and coupon bonds. Under what conditions will a coupon bond sell at a p

Compute the present value of an annuity of 880 per year

Compute the present value of an annuity of $ 880 per year for 16 years, given a discount rate of 6 percent per annum. As

Compute the present value of an 1150 payment made in ten

Compute the present value of an $1,150 payment made in ten years when the discount rate is 12 percent. (Do not round int

Compute the present value of an annuity of 699 per year

Compute the present value of an annuity of $ 699 per year for 19 years, given a discount rate of 6 percent per annum. As