Question: To implement a BTree class in C++ that allows: - the definition of the order (K) of the node (this can be implemented as a

To implement a BTree class in C++ that allows:

- the definition of the order (K) of the node (this can be implemented as a method or as a parameter directly in the constructor of the class

- A method for searching a given key "KEY" in the tree, that returns the pointer to the node that contains the KEY plus the integer index of the given key in that page or null if KEY is not present in the tree

- A method for insertions of integer numbers in the tree. This should take the value of order K into consideration, meaning that each node must store m elements where: K/2 <= m <= K

- A method for deletions of integers numbers from the tree. Remember to consider rotations and joins operations If necessary

- All three traversals: inorder, preorder, postorder

- A method to determine the height of the tree

Should also be implemented an external program that instantiates an object of this class using K = 50000 and inserts 1 million (1.000.000) DISTINCT random numbers and determines the height of the resulting tree.

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!