Feel free to draw diagrams on the board as you and your fellow students work out the details, but try to come up with the actual code individually. This lab is due at 9:00 am this Friday morning.
cp -rd ~mc38/labs/mostFrequentLine/files mostFrequentLineThe
-r flag says copy the whole directory. The
-d flag says copy symbolic links instead of copying whole
files.
karls-solution, as well as links to all three data files
called web-hits-1k, web-hits-9.1k, and
web-hits-92.1k which contain (roughly) 1000, 9,100, and
92,100 lines, respectively. These were taken from the monthly log of
our web server a few years ago. To try out the program, type
./karls-solution < web-hits-1k
Note: since the third file (web-hits-92.1k) is
so large, you should be sure that you have linked, rather than copied,
the data files, as we instructed you to do.
Node.
StringToIntTableRep.
findNodePtr in the
StringToIntTableRep class. Done correctly, this will not
require much code, so be sure to think before coding.
int& operator[](const string
str). Given findNodePtr, this should not be too hard.
./mostFrequentLine < web-hits-1kfor example (assuming
web-hits-1k is in your directory).
mostFrequentLine.cc so that it prints out
the 10 most frequent lines.