6.170 Laboratory in Software Engineering
Spring 2001
Problem Set 0: Programming Diagnostic
Due: Thursday, February 8 at 5:00pm

Handout P0


Purpose

This is a very short assignment that will check whether you have the background we expect in 6.170. If the assignment takes you more than an hour, you should expect to do extra work over the first three weeks of the course to improve your basic programming skills, or should re-evaluate whether to take the course.

The Problem

Write a procedure that takes a string and returns the longest repeated substring. A repeated substring is a sequence of characters that is immediately followed by itself. For example, Given "Mississippi", your procedure would return "iss" or "ssi". Given "Massachusetts", your procedure would return either "s" or "t". Given "Rhode Island", your procedure would return "" (the empty string).

The procedure should take a single argument of string type and return a single result of string type. You may write your solution in Scheme, Java, C, or C++. (If you write in Scheme, and you prefer to use its list operators, you may find the string->list and list->string procedures helpful; or, you can use its string operations.)

You should test and document the procedure in whatever manner seems appropriate to you.

Turn in hardcopy of your code, documentation, and tests, and the output of your program when run on your tests. The tests should include, at the least, output for the three inputs given above. Submit these materials to the course secretary's office, NE43-529; be sure to include write your name, your recitation number, and your recitation instructor's name.


$Id: ps0.html,v 1.2 2001/02/04 23:25:29 mistere Exp $