Question: Question 1 Consider the following algorithm: function FANCYINSERT array, ( : m : Z + } let n be the size of N let T

Question 1
Consider the following algorithm:
function FANCYINSERT array, (:m:Z+}
let n be the size of N
let T be an empty B-Tree of order m
for i from 0 to n-1 do
if i is even then
T.INSERT (N[i2])
else
T.INSERT(N[n-(i-12)-1])
end if
end for
return T
end function
a Give an array N storing the numbers from 1 to 7 such that FANCYINSERT(N,3) returns a B-Tree consisting only of 2-nodes (i.e., all nodes have at most two children).
b Give an array N storing the numbers from 1 to 7 such that FANCYINSERT(N,3) returns the following B-Tree:
Question 1
Consider the following algorithm:
function FANCYINSERT : array, (:m:Z+}
let n be the size of N
let T be an empty B-Tree of order m
for i from 0 to n-1 do
if i is even then
T.INSERT (N[i2])
else
T.InSERT(N[n-(i-12)-1])
end if
end for
return T
end function
a Give an array N storing the numbers from 1 to 7 such that FANCyInSERT(N,3) returns a B-Tree consisting only of 2-nodes (i.e., all nodes have at most two children).
b Give an array N storing the numbers from 1 to 7 such that FANCyInSERT(N,3) returns the following B-Tree:
c Show the insertions (one number at a time in the required order) of your array N(from part b) in T as performed by FANCYInsERT (N,3).
 Question 1 Consider the following algorithm: function FANCYINSERT array, (:m:Z+} let

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!