CMPS 3350 Lab-7

Code Optimization

Exercise:
Please do your work on the Odin server in your /3350/7 folder.
 Start by getting the lab-7 framework.
  Located on Odin at...
   /home/fac/gordon/p/3350/code/lab7/*
    Copy all the files from the lab7 folder.
     Build and run the program.
      Below are three test runs of the program.

$ make $ ./lab7 Usage: ./lab7 <input file-name>
$ ./lab7 test Lab-7 program optimization. spell-check this file: **test** Misspelled: mispellled Misspelled: werd Total misspelled words: 2 Program complete.
Processing a larger text file. Shown is how to record the program running time...
$ time ./lab7 article Lab-7 program optimization. spell-check this file: **article** Misspelled: sepg Misspelled: sdm Misspelled: didn't Misspelled: sdlc Misspelled: sdlc Misspelled: conglomerates Misspelled: proscriptive Misspelled: sdlc Misspelled: deliberatly Misspelled: offs Misspelled: outsized Misspelled: unusably Misspelled: intel Misspelled: use/load Misspelled: roundtrips Misspelled: one-pass Misspelled: c-language Misspelled: sync Total misspelled words: 18 Program complete. real 0m12.898s user 0m12.805s sys 0m0.093s

Assignment
Your task is to optimize the uvlab7.cpp program.
The program should run faster.

Your goal is to spell-check the article file in under 1-second.
You should make brief comments about your optimizations as you go.
Your final program should be neat, clean, easy to read,
and meet our 3350 coding standards.

Please, no use of...
   STL algorithms, containers, functions, iterators.
    #include <algorithm> 
    #include <vector> 
    #include <set> 



You are in competition with other students in the class to make the fastest running program. 1. The program output format must match that above. 2. Do not copy the dictionary file into your folder or program. 3. Ignore case when spell-checking, as currently done. 4. Strip period, comma, etc. off the end of a word, as currently done. 5. Submit individual work in your /3350/7 folder. 6. Your program will be timed using a mystery text file. • Your program should work with any text input file. • Your program should work if the words in the dictionary file change.

What to turn in?
Gordon will find your work on Odin.
   /3350/7/uvlab7.cpp
   /3350/7/Makefile