PSet2 FAQ

From 6.006 Wiki

(Difference between revisions)
Jump to: navigation, search
m
m
Line 1: Line 1:
== Questions ==
== Questions ==
-
== Staff solution info ==
+
== Staff clarifications ==
-
Running times for Part A:
+
=== emailed out Saturday 10/04 ===
 +
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.
== Common Mistakes ==
== Common Mistakes ==

Revision as of 20:47, 4 October 2008

Contents

Questions

Staff clarifications

emailed out Saturday 10/04

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.

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