CSCI 151 - Program 2

B + - Trees

Dr. Melody Stapleton, Instructor

Due Date: self-paced Internet course - student determines due date

Your TA will provide the final input file(s) to run your program against.

Your are to implement an order 3 and an order 7 B+-Tree, as discussed in class and in Drozdek's book   The insert and delete processes for B-Trees needs to be modified to accommodate the special features of B+ Trees.

***************************************

You are to structure your main program to accept and interpret file input with the following format:

You will need to write your program to accept a series of "commands" from an input file. Listed below are the possibilities for the different categories of commands that will follow the above line in the input file(s):

You will, of course, need to create a B+-Tree class that has at least the following member functions:

Output: Send your output for this program to a file.  For inserts, it is an error to insert a duplicate value in the B+-Tree structure, be sure to notify the user of such an attempt.  Tell the user if an operation is successful, as well.  Be sure to give appropriate "error" messages back to the user of your program, via the output file.  For e.g., if asked to delete a value from the B+-Tree structure that is not found in the structure, you should reply that the value was not found and so could not be deleted.  

Also Note: You are responsible to write a program that deals with *all cases*.  That is, your program should not only *work good on some input files*, it needs to work on *all possible* input files.  This means it is not your TAs responsibility to give you an input file that allows your program to work.  It is your responsibility to write code that cannot be broken by any input file and so will work in all cases.  This will be the case for every program you write for this course.

Extra Credit:  If you implement the B+ Tree for a general order, to be specified at run-time, then you will receive up to 10% extra credit for a possible score of 110% on the program.

A sample file follows that adheres to the input file format:

A  46

A 55

A 88

P

S 46

S 99

A 99

D 50

S 200

A 200

D 55

P

A 120

A 200

A 300

A 400

A 500

A 12

A 59

A 62

A 99

A 98

A 93

A 47

A 88

A 100

A 29

A 35

A 54

A 33

A 22

A 331

A 342

A 302

A 999

A 445

A 999

A 532

A 501

A 444

S 300

P

D 600

D 500