This project is about the use of Binary Search Trees, Skip Lists, Hash Tables. This handout is a print out of file p2.html. You will find several related files in our public directory.
I will answer questions relating to P2 in our newsgroup news:wright.cs.400. Keep an eye on this newsgroup.
We wish to count how many times each word of a text file appears in that file. The name of this file is given as an argument to your program. Name this program wordCount. The program is required to output a sequence of lines, one per word. Each output line consists of a word followed by its count of how many times it appeared in the input file.
Implement the "dictionary" of words appearing in the file as (1) a hash table with quadratic probing, (2) as a binary search tree, and (3) as a skip list. You need to keep track of not only the spelling of a word, but also how many times it has so far appeared in the file. The output files resulting from the three dictionaries should be equivalent: all the words appear, and their counts are equal.
Follow the style guidelines given in {\tt c++Style.html}.
As each word is obtained, insert it into all the dictionaries. If the word is already present, only the count is incremented.
#pragma interface /* in "bst.h" */ #pragma implementation /* in "bst.C" */and compile with the flag -fexternal-templates, i.e.,
CFLAGS = -c -g -Wall -ansi -pedantic -fexternal-templates ## in "Makefile"
One test input file hehner.txt is provided. But you should test your program on several (small/medium/large) files. We also hope you will personally read and follow the advice of Hehner.
Submit your solution electronically using turnin P2 <files>. It should include a Makefile, the source code files, and test input files of your choice, and their output files, a ReadMe.txt file, and a successfully run typescript file. We may make and run your program on our own test files.