Please carefully read the Academic Integrity before you start working on the homework assignments.

In short, you can get help from the instructors, TAs, textbooks (or relevant books), the Internet, or discussions with your classmates, but you must cite them fully and completely (i.e., provide citations to the book or website link, acknowledge the other students that had discussions with you). Again, you are NOT allowed to:

  • copy anything from the book or the Internet,
  • read or look at anyone else’s solutions (write-up or code),
  • share your solutions (write-up or code) with any other students, during or after the completion of the course.

When you write down your solution, it MUST be close-book. This is to make sure you truly understand and can recreate the solutions.

📃 Course Policy Test

We have a course policy test about academic integrity and course policy. It takes 1/100 point in your overall grade. This test is due on 01/12.

📃 Entrance Exam

There is an entrance exam for this course. There are 4 programming problems, covering several important algorithms you should have learned in prerequisite courses (simple programming, simple sorting, graph algorithms, and some algorithm design ideas). You need to finish them in the first week. They will take 9/100 points in your overall grade. The four problems will be 11 points in total, and the full mark is 9 points. If you get more than 9 points, they will count as bonus points. Ideally you should pass all the 4 problems. ⚠ We would not recommend anyone getting <= 6 points to take the course.

If you cannot finish them in the first week, then CS 142 can be very challenging for you. You should consider taking prerequi courses for algorithms and programming, including CS 10A/B/C, 11, 111 and 141.

Problem-Solving Assignments

All problems will be given on codeforces (including the entrance exam), so we do not post the problems here.

We will use CodeForces to submit and test codes. You also need to submit a short report to describe your algorithm and specify your submission id. Here is a guideline about using CodeForces. Here is a beginner’s cheatsheet for learning programming.

We run automatic code comparison programs on student solutions. These programs are very good at detecting similarity between code, even code that has been purposefully obfuscated. Such programs can compare a submitted assignment against all other submitted assignments, against all known previous solutions of a problem, etc. The signal-to-noise ratio of such comparisons is usually very distinctive, making it very clear what code is a student’s original creative work and what code is merely transcribed from some other source. Cheating is simply not worth the risk.

You need to submit a brief report on how you solved these problems, including:

  • Your name, SID and/or NETID, and your codeforces ID;
  • Submission ID (there is a unique id for each submission);
  • Describe the algorithm you designed;
  • Show cost analysis if necessary.

You will not get the point if you don’t provide the report to explain how your algorithm works.

Assignment Deadline
Problem-Solving I 02/07
Problem-Solving II 02/28
Problem-Solving III 03/14

Each programming assignment takes 10/100 points in your overall grade. In each assignment, there are six problems. The first three problems are basic problems, and are easier. Each of them is worth for 3 points.
The last three problems are challenge problems and are haeder. Each of them is 1 point.

You can get 12 points at maximum for each assignment. If you get more than 10 points in one assignment, they will be counted as bonus bonus. Note that you need to finish at least 1 challenge problem to get full points.

For challenge programming assignments, you can work on them after the deadline - as long as you finish them before the end of the class, you can still get half of the credits.

Performance-Engineering Assignments

Performance-Engineering Assignments are mini projects that requires programming. Generally, your goal is to write parallel code to engineer a specific problem. You will test and run your code on a server at UCR, and the detailed instruction will be given in the assignment problem description.

Each performance-engineering assignment contributes 15/100 to your overall grade. Similar to the problem-solving training, you can get more than 15 points if you get the bonus points.

Assignment Deadline
Performance-Engineering I 01/31
Performance-Engineering II 02/21

Written Assignments

There are two written assignmetns. Each takes 5/100 points in your overall grade. The written part is similar to other algorithm courses you have taken, and you must use LaTeX to prepare your solution. Here you can find sample code for writing solutions using LaTeX.

In grading, we will reward not only correctness but also clarity and simplicity. To avoid losing points for hard-to-understand solutions, you should make sure your solutions are either self-explanatory or contains good explanations. Please understand that grading your assignments is a lot of work for your TAs and readers, especially determining the correctness and cost bounds for your algorithms. We reserve the right to manually deduct points for solutions that are conceptually correct but does not show a sincere attempt to explain the ideas clearly.

Assignment Deadline
Written I 01/24
Written II 02/14


At the end of the class, you can choose to give a presentation in class to get bonus points. We encourage you to present one of your favorite bonus questions and your solution to the class. For bonus question presentation, you have to pass all the test cases before the presentation.