Lab 6

Iteration vs. Recursion

Due Wednesday, April 26, 11:55pm. Submission through SVN.
Please submit your work in SVN directory
https://www.cs.usfca.edu/svn/< your username >/cs112/lab6

e.g.
https://www.cs.usfca.edu/svn/ejung/cs112/lab6

Goal

This lab is designed for you to practice using recursion and compare its performance to an iterative version. You will design and implement a word frequency counter. Word frequency is heavily used in search engine and data mining. In particular, Term Frequency-Inverse Document Frequency (TF-IDF) is often used to compute how relevant each document is to given keywords. Many search engine algorithms include TF-IDF in their ranking. Your program will take a file name as a program argument, and print out the list of (word, frequency) pairs. Write two versions, recursive and iterative.

Specifications

Hint

To compare your output to the example run, diff is a great software in linux and Mac. The usage is
diff file1 file2

Example Run

The sample file is from this blog post. The output for this sample file is here.

What to submit

README, and all Java files.