PSet2 FAQ

From 6.006 Wiki

Revision as of 01:52, 6 October 2008 by Juang (Talk | contribs)
Jump to: navigation, search

Contents

Questions

Staff clarifications and Errata

Saturday, October 4: Problem 1 testing

When you submit your code for Problem Set 2-A, the server will run the test script that we have given you, with slight modifications:

For Problem 1(c), only the 100-, 1000-, and 10000-character tests will be run. The 100000-character test is likely to take too long, run out of memory, or both, so don't worry if your code doesn't pass it on your machine. The server will enforce a 15-second time limit for this part. (The staff solution runs in less than 1 second.)

For Problem 1(d), all four tests will be run. The server will enforce a 180-second time limit for this part. (The staff solution runs in less than 30 seconds.)

If your code runs over time, the server will only say "runtime error", and the output of the program might contain the word "Terminated". It's kind of a cryptic error message--sorry about that. We're working to improve that.

Effective Saturday evening, if your code runs over time, the server will kill it and give you the message "time limit exceeded".

Sunday, October 5: Part 1(f) (optional)

The LaTeX template suggests that you can submit your substring5.py code online, but there is no way to do that. We don't want you to upload your code -- just describe your algorithm.

Common Mistakes

general debugging hints

  • adding asserts to your code can help you to ensure that values are what you expect them to be at all times
  • write your code modularly: use submethods for any non-trivial repeated or similar code.
  • write unit tests for each of the submethods written
  • separate complicated computations into smaller pieces which can then be asserted on.
  • try to find out where the time is going, are some methods being called more often than you expect them to? do they take longer to execute than expected?
Personal tools