# Written Homework Guidelines and Requirements

For written homeworks, we require that you follow these guidelines:

### 1. Using LaTeX

• All your written homeworks should be typeset in LaTeX. Many online resources are available that explain how to install it. You generally must install a distribution such as MiKTeX then install a software that compiles LaTeX, such as Texmaker.
• You probably already have this part set up from CIS 160. If not, please follow instructions here.
• We require that you stick to our template. It is available on the Homework Tab.

### 2. Using References (if needed!)

• We encourage you to use references you find to supplement your answers on the homework. Part of being good at solving problems is using previously solved problems to your advantage. However, please stick to the following sources only:
• Textbook (CLRS)
• Lectures (What the professor teaches you)
• Readings (Assigned by the professor)
• Recitation labs (PDFs that you find on the Course Website)
• Examples of sources we will not accept are statements said by TAs in recitations. We will certainly not accept references from other online sources (you should not visit StackExchange or similar sites!).
• Please make sure to reference your source correctly (reading name, page, etc.). If you are not accurate in your reference, we might not consider it.

### 3. Describing Algorithms

• Many problems in CIS 121 require you to come up with algorithms (in homeworks and tests alike). When we ask you to do so, we expect the following three steps (except when otherwise noted!):
1. Description of Algorithm: A precise description of your algorithm in English. No pseudocode, no code.
2. Proof of Correctness: Sufficiently rigorous. Covers all cases if needed. Proving that the algorithm works on all correct inputs, fails on all incorrect inputs, and terminates.
3. Proof of Runtime Bound: Same as above. You have to prove the runtime of all the operations involved in your algorithm, generally involving the time needed to construct your data structures. If in class you learned a specific algorithm with its runtime, you do not have to prove it anymore as you can simply cite it.

### 4. Drawing Trees

• In some homeworks, you might need to draw trees in LaTeX. You can use this online (free!) resource to draw trees quickly and generate LaTeX code for them. The instructions for drawing trees are at the bottom of the linked page.
• Mac users: to delete a node, click on it and then press fn + delete.
• To export to LaTeX, hit the LaTeX link on the page. Make sure to add the package tikz\usepackage{tikz} — or your LaTeX code won’t compile.

### 5. Selecting Pages on Gradescope

• You must select the appropriate pages on Gradescope. Gradescope makes this easy for you: before you submit, it asks you to associate pages with the homework questions. Failing to do so will get you points off, which cannot be argued against after the fact. Gradescope may prompt you with a warning to select your cover page, please ignore this warning.

Should you have any questions, please do not hesitate to post them on Piazza, or bring them to Office Hours!