keyboard

CoSc2030: Computer Science II

Fall Semester 2007
Instructor: Dr. Thomas Bailey

Lab 13: Suffix Lists, part 1

Today we will be looking at suffix lists. In this lab, suffix lists are composed of string iterator pairs. Any pair of strings that contain the same characters in the same order are a match. Suffix lists are useful for many different things, and are often used in bio-informatics. To start this lab, download the code provided by Dr. Bailey.  SuffixListDriver04.cpp, Files.cpp, Files.h, StringSegment03.cpp, StringSegment03.h, SuffixList03.cpp, and SuffixList03.h -Now, take a look at the code and try to figure out what the code is doing. If you have questions, ask your lab assistant. You will need to write a test file so that you can check and see if your code is working.

Lab Assignment:

  1. Your first task will be to give functionality to the < operator in StringSegment03.cpp. Look in StringSegment03.h for the method definition.
  2. Now write the code for the matchLength method in StringSegment03.cpp; again the method definition is in StringSegment03.h.
  3. Finally add a method called is_prefix to StringSegment03.cpp that compares two string segments and returns true if the first is a prefix of the other. Eg. "to" is a prefix of "today". The method definition is in StringSegment03.h.
  4. Your final challenge in this lab, is to develop some tests in SuffixListDriver04.cpp for the code that you wrote. Also, come up with some ideas about what you think this code could be used for and write them in comments at the top of SuffixListDriver04.cpp.

Turn In:

Upload Lab13SuffixListDriver.cpp and Lab13StringSegment.cpp with your name in comments at the top. You have one week from you lab period to turn in the lab.

<< CoSc2030 Home
Copyright © 2005 Thomas Bailey