Here is a simple input file that tests only the insert, delete search and print functions. It does not test your input abilites, nor any collapsing of the tree. I include here the output file guidelines:

OUTPUT SAMPLE and GUIDLINES

Here is the output I got from the test file I gave you. Note the following:

Please title the output file output.dat, and make sure you open your output.dat file so that it appends each run to the end of the file (use ios::app). Do not truncate, as you will be left with only the last run.

Each command read in should output success:, error: or Print:. Note that they each end with a colon. Note also that you do not need to echo the command input (eg I 0), nor any other information (eg "bad input). You are free to do so, cut loose and be creative, as long as the echo (eg error:) is output.

The print command should be followed, on the next line, by each node's address, followed by a colon, and a whitespace (eg space) character delimited listing of the records in that nodes bucket. Nodes that do not have buckets should NOT be listed. Note that the address of the root node should be NULL.

The program should terminate by printing at least one * character and an endl. This will serve to separate the different outputs from your program runs.

If there is no input (eg blank line) that should be ignored, as should extra whitespace. Any illegal commands or values should be noted as an error in the output file.

The test input file:

8
2
S 4
D 7
I 0
I 7
P
I 1
I 6
P
D 7
P
I 15
I 2
I 4
P
D 1
I 3
I 5
P
D 2
I 10
I 11
P
D 7
S 99
S 1
I 9
I 8
I 12
I 13
I 14
I 22
I 30
P
S 30
S 38
I 23
D 6
D 14
D 22
P

The sample output file.

error: S 4 Record not found
error: D 7 Record not found
success: I 0
success: I 7
Print:
NULL: 0 7
success: I 1
success: I 6
Print:
0: 0 1
1: 7 6
success: D 7
Print:
0: 0 1
1: 6
success: I 15
success: I 2
success: I 4
Print:
00: 0 1
01: 2
10: 4
11: 6 15
success: D 1
success: I 3
success: I 5
Print:
00: 0
01: 2 3
10: 4 5
11: 6 15
success: D 2
success: I 10
success: I 11
Print:
00: 0
010: 10
011: 3 11
10: 4 5
11: 6 15
error: D 7 Record not found
error: S 99 Record not found
error: S 1 Record not found
success: I 9
success: I 8
success: I 12
success: I 13
success: I 14
success: I 22
success: I 30
Print:
000: 0 8
001: 9
010: 10
011: 3 11
100: 4 12
101: 5 13
110: 6 14 22 30
111: 15
success: S 30
error: S 38 Record not found
success: I 23
success: D 6
success: D 14
success: D 22
Print:
000: 0 8
001: 9
010: 10
011: 3 11
100: 4 12
101: 5 13
110: 30
111: 15 23