1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
Anon25 [30]
3 years ago
13

Write a Java method to delete a record from a B-tree of order n.

Computers and Technology
1 answer:
max2010maxim [7]3 years ago
6 0

Answer:

Deleting a record on a B-tree consists of three main events:

- Searching the node where the key to be deleted exists

- Deleting the key

- Balancing the tree if required

Explanation:

q = NULL;

   p = tree;

   while (p) {

       i = nodesearch(p, key);

       q = p;

       if (i < used(p) -1 && key == k(p,i)) {

           found = TRUE;

           position = i;

           break;

       }

       p = son(p,i);

   }

   if (!found)

   else if (subtree(p)) {

         if (used(p) > ((n-1)/2)+1)

         delkey (p, position, key);

       else {

           replace (p, position, fsucc(p));

           p0 r1 p1 r2 p2 r3 ……. pn-1 rn-1 pn

           q = &fsucc(p);

           qpos = index of fsucc;

           if (used(rbrother(p)) > ((n-1)/2)+1)

               replace (q, qpos, sonsucc(q));

           else

               while (q && used(q) < (n-1)/2) {

                   concatenate(q, brother(q));

                   q = father(q);

               }

       }

   }

   else

   delkey(p, position, key);

}

You might be interested in
The blank contains the computer's brain the central processing unit CPU
Ipatiy [6.2K]

The central processing unit (CPU), also called a processor, is located inside the computer case on the motherboard. Hope it helps (:

6 0
3 years ago
How many levels of full body protective clothing are there? A. Four B. Seven C. Six D. Two
Verdich [7]
The answer is A. Four
4 0
3 years ago
Read 2 more answers
Alkane is a Variety of which fruit
icang [17]
Several different alkane fruits.
watermelon cantaloupe mango pears grapes passion fruit dried fruits like dates and apricots figs and raisins are also considered heavy alkaline foods apples, fresh apricots bananas berries and avocados.... list goes on.
4 0
3 years ago
What is number system?<br>​
MrMuchimi

Answer:

A numeral system is a writing system for expressing numbers; that is, a mathematical notation for representing numbers of a given set, using digits or other symbols in a consistent manner. The same sequence of symbols may represent different numbers in different numeral systems.

Explanation:

8 0
3 years ago
Which set of symbols can be used to determine which calculations to perform first?
Monica [59]

Answer:

parentheses

Explanation: hope i helped <3 °ω°

5 0
4 years ago
Read 2 more answers
Other questions:
  • Pedestrians, cyclists, horse drawn vehicles and wheel chair users are known as ___________
    6·2 answers
  • What does the picture indicate on the famous book “Dawn of the century”?​
    10·1 answer
  • Look at the following program and answer the question that follows it. 1 // This program displays my gross wages. 2 // I worked
    8·1 answer
  • What are the names of the four major varnas in the caste system?​
    9·2 answers
  • Activity
    7·1 answer
  • Define a function pyramid_volume with parameters base_length, base_width, and pyramid_height, that returns the volume of a pyram
    6·2 answers
  • PLZ HELP I AM TIMED!!!!
    11·2 answers
  • What is algorithm and how does it works​
    11·2 answers
  • (1) Prompt the user to enter two words and a number, storing each into separate variables. Then, output those three values on a
    10·1 answer
  • Scientist Galileo Galilei used the
    6·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!