CS 240 Assignment Guidelines
CS 240 Assignment Guidelines
1 General Requirements
The solutions you hand in must be your own work. In particular, you are not supposed to
look up the solutions in the literature or on the Internet. Assignments will involve
mostly ”written” (non-programming) work but may also have a programming component.
Both parts will need to be submitted electronically through MarkUs. Written work is to be
submitted in a pdf file and, if the assignment includes a programming part, you must submit
the program file with the file name specified in the assignment. No late assignments will
be accepted.
Tools/methods for creating pdf files for written solutions are provided on the website
at https://www.student.cs.uwaterloo.ca/~cs240/s18/assignments.phtml
MarkUs is a web-interfaced submission and marking system. Instructions for submit-
ting assignments to MarkUs and for using MarkUs to view your marked work are on
the website at https://www.student.cs.uwaterloo.ca/~cs240/s18/assignments.phtml
You should always check whether all files you wanted to submit were accepted on MarkUs.
Note that you can always re-submit new versions of your files, delete previously submitted
files, or submit different parts of the assignment at different times. Programming questions
may also require a written description of algorithms, data structure design overview, proofs,
analysis, etc. Submit any requested additional information (other than code) together in the
pdf file with the written parts.
We recommend that you start early and submit partial solutions, especially for the pro-
gramming parts, as you finish them, instead of waiting until the last moment.
1
2 Non-programming Questions
Ensure that your solutions are complete and mathematically precise, and at the same time,
easy to understand and to the point. Your solutions will be judged not only for correctness,
but also for quality of your presentation and explanations. Justifications of all claims are
implicitly required unless stated otherwise.
In questions that involve designing an algorithm or a data structure, you should
(unless stated otherwise) design the best algorithms you can come up with. The first criterion
for marking is the correctness, the second criterion is efficiency. Thus, an algorithm which
is slow but correct will receive substantially more marks than an algorithm which is fast
but incorrect. Inefficient algorithms will not earn full marks. In your solution, enclose the
following:
• present a clearly written pseudocode (at a level of detail mimicking the style of the
lectures, the model solutions, or the book),
Unless indicated otherwise, logarithms are base 2. I.e. log = log2 and the function log2 n
means (log n)2 .
3 Programming Questions
Programming questions will usually involve designing an algorithm or a data structure, and
implementing it. The above mentioned guidelines and requirements for algorithm design
questions are to be fully applied to programming questions as well. The rest of this section
deals with the instructions for the programming part of the questions.
Your program should be implemented in C++ on the undergrad Linux environment
(ubuntu.student.cs.uwaterloo.ca). If you are working on a different platform, it is your
responsibility to ensure that your program runs properly on the undergrad environment.
Programs will generally be expected to read from the standard input stream (std::cin)
and write to the standard output stream (std::cout). That is, no file names will be given on
the command line. Assignments may also specify the names of certain classes that should be
implemented, in addition to a main method. Good programming practice generally dictates
that each class definition should appear in a separate header file, to be included in the main
file. The names of all files to be submitted will be specified in the assignment,
along with their contents. Skeleton code will usually be distributed for all these files as
well.
2
We will compile and run your program as follows:
Since we will compile/run/test your program using an automatic script, it is vital that
you follow our instructions to the letter. In particular, your program should read only from
cin and write only to cout, in the format exactly as specified in the assignment. It is a good
idea to test your program thoroughly yourself (on your own input) to ensure its correctness.
We recommend you use the standard error stream std::cerr for debugging output, which
will be ignored by our marking scripts. Some additional pre-testing might be available—this
will be announced in the course newsgroup (Piazza).
Marking of programming questions will be based on both correctness (as determined by
our test runs) and coding style (documentation, design, clarity, etc.).
4 Further information
If you have any questions about the formatting of assignments, or about how much informa-
tion to include, ask the tutor or make a newsgroup (Piazza) post. Also be sure to check the
website at https://www.student.cs.uwaterloo.ca/~cs240/s18/info.phtml for details
on the return policy, remark requests, and academic dishonesty (cheating).
3
8. Make your solution look more like the text from the text book rather than quick-and-
dirty notes from the class.