Introduction

We continue working with the code developed in Lab 7.1 to implement quicksort. Turn in clean, commented, code that compiles and runs as intended.

Specific requirements

  1. Releases as described below.
  2. Generated HTML javadoc documentation for each release.
  3. A lab report with standard sections (Problem Statement, Program Flow, Classes Needed, Discussion, and Project Code)

Due dates

Create a class WordLister that reads the contents of an input file, extracts the words found in it, and then writes them to an output file.

Release 0.5

When run, program should:

  1. prompt user for an input file and an output file.
  2. open the input file and read and store its contents into an array [hint: one approach is to use a buffered file reader, i.e., a FileReader object wrapped in a BufferedReader].
  3. all alphabetic words should be converted to lowercase and stored.
  4. ignore whitespace (space, tab, newline characters, ...) [hint: you could use the .split method on strings]
  5. ignore any sequences with non-alphabetic characters (R45, CUL8R, ...) [hint: you could use the .matches method]
  6. finally, when entire input file has been read and processed, open the output file and write the words, separated by spaces.

Release 1.0

In this release you will use the partitioning method you've already built to implement quicksort. Review pages 325-355 of the text

  1. modify release 0.5 above so that the words are stored in a PArray (from lab 7.1) rather than an array.
  2. add a method qSort in your PArray class that implements the quicksort algorithm described in the text.
  3. update WordLister from Release 0.5 so that, after the input file is read and words are stored in a PArray, they are quicksorted before being written to the output file.

 

 

Copyright © 1999-2008| Gene Rohrbaugh | Privacy Statement