The purpose of this assignment is to try out Binary Search Trees and Hash Tables as index structures for database systems. To make it easy on all of us, we will use the SEND EVENTS defined in Project 1 as the records to be stored and retrieved. Only the send events! No Event_Queue and no Mail_Queues in this one. Instead there will be a binary search tree and a hash table.
You must implement the binary search tree and the hash table yourselves; do not use any BST or Hash Table class you may have. It is OK to use a linked list class from either Java or C++.
There are also statistics on the test retrievals for the tree.
These access statistics can be computed as you do the accesses.
All BST statistics should be output to BST.txt:
The access statistics for hash tables are as follows.
All hash table statistics should be output to Hash.txt:
Bin 0 -> 25 -> 98 -> 143
Bin 1 -> empty
etc.
event_id event_type time
receiver_id sender_id priority
message
1
S 652
10
10 1
Assignments are so easy
2
S 362
10
20 1
Midterm is coming soon
3
S 561
20
10 3
CSE373 is interesting
Download sending event files: 20E 300E
There are also query files for each event file: 20E-1, 20E-2, 300E-1, 300E-2, 300E-3, 300E-4
For the 20-event data set, try 30 and 50 for the size of the hash table. For the 300-event data set, try 700 for the size of the hash table. You should make the hash table size a command line argument to your program.
1. Compilable. Any program that cannot compile will receive a low grade.
2. Correctness. We will run your program by "java Statistics eventfilename queryfilename HashTableSize" (or "Statistics eventfilename queryfilename HashTableSize" for C++ programs). Then your program produces BST.txt, Hash.txt and Chain.txt, which contain all the statistics required. We may specify the HashTableSize as follows: 50 for the 20 events, and 700 for the 300 events.
3. Clearness of code, good coding style, simpleness, etc.
4. Readme.txt, explaining how you implement your Binary Search Tree and Hash
Table, and how you compute the statistics for both of them.
All source files should be turned in online.
Java programmers: Make sure your program is compatible with Java2 SDK 1.4.x. Turn in only .java source files. You must include your main method in Statistics.java. Go to http://www.cs.washington.edu/education/courses/373/03sp/homework/prj2/turnin-java.html
C++ programmers: Your programs are strongly suggested to be compatible with MSVC 6.0. By default, your program will be compiled by MSVC 6.0 compiler at turn-in time. If your program only works on Linux/Unix, you must include detailed information in Readme.txt showing how to compile and run your program. Turn in only .cpp and .h files. You must include your main function in Statistics.cpp.