The source code for the first part of the word frequency program discussed in today's lecture is available here (zip file). This code provides a good answer to Exercise 3-3 in the homework but doesn't include the extra code that produces as the output a listing of the N most frequent words and their frequencies, in nonincreasing order. Try extending the code to do that yourself (again, attempting to make good use of the standard library to obtain a compact and efficient solution). |