CS 161

Other Resources

We really want everyone to succeed in CS161! In addition to resources like lecture materials, Ed, etc., here are some additional resources and information that may help.

Accommodations

Students who may need academic accommodations based on the impact of a disability should initiate the request with the Office of Accessible Education (OAE) and notify us as soon as possible. For exam accommodations, please notify us by April 12, if possible. For homework accommodations, please contact us a few days in advance of the due date if possible. It is the student’s responsibility to reach out to the course staff regarding their accommodations on exams and assignments in advance. Please email OAE forms to cs161-spr2223-staff@lists.stanford.edu.

Mental Health

Your mental health is important: In addition to algorithmic know-how, we hope that this course will produce/maintain happy and healthy students. Here are some resources for mental health on campus:

The folks on the other end of those resources are way more qualified than the course staff to help with mental health issues. That said, if there's something we can do in CS161 to help out, please let us know (post privately on Ed or email the staff list; note that the staff list is read only by Mary, the head CAs, and the Student Liaison CA). In particular, if you are feeling overwhelmed, we can work with you to come up with a plan to study/catch up/whatever you need.

Textbooks

Primary textbook(s): Algorithms Illuminated.

  • Tim Roughgarden, Algorithms Illuminated, Volumes I, II, and III. Soundlikeyourself publishing.
  • Even though these are three books, they are small, paperback, and cheap! (Currently they are $10 each as an ebook or $15-ish in print). And they are in the library!
  • Additional resources, including video lectures by Tim Roughgarden, can be found here.

Supplementary textbook: CLRS.

  • Thomas H. Cormen, Charles E. Leiserson, Ronald L. Rivest, Clifford Stein, Introduction to Algorithms, 3rd Edition, MIT Press.
  • This book is available online for free through the stanford library.
  • CLRS has much more detail than Algorithms Illuminated, and is a great resource for additional details.

You might also find the following textbooks to be helpful references:

  • Jon Kleinberg, Éva Tardos: Algorithm Design
  • Sanjoy Dasgupta, Christos Papadimitriou, Umesh Vazirani: Algorithms

Algorithm Problem-Solving Resources

Are you having trouble getting started on a homework problem, prepping for an exam, or simply looking to get a better grasp of how to approach algorithm-focused questions?

Then check out this handy Algorithms Problem-Solving Guide.

List of Summation Formulae

Check out our List of Summation Formulae for CS 161.

Prerequisite Resources

If you'd like a refresher on prerequisite material for the course, we'd recommend these handy guides from Ian Tullis:

LaTeX Resources

We strongly recommend typesetting solutions to homework sets in LaTeX. LaTeX is the standard for typesetting CS/math/etc papers, and will likely come in handy outside CS161.

  • Example LaTeX solution set: See the Homework Resources section below for an example of a LaTeX'd solution set and a LaTeX template. These solutions include examples of pseudocode in a few different environments, as well as examples of how to include images and figures.
  • Guides to using LaTeX: An introduction to LaTeX can be found here. Other guides can be found at Wikibooks and NYU.
  • Online Environments: If you don't want to install LaTeX, ShareLaTeX and Overleaf are online environments which compile previews of your LaTeX documents as you type, and share your LaTeX with the rest of your HW group. Stanford students get a free OverLeaf Pro account.
  • LaTeX Editors: There are many LaTeX editors which allow you to use GUI to edit your LaTeX. LyX is a free one.
  • Finding symbols: Detexify lets you draw the symbol that you are looking for and get LaTeX code. A static guide is here.

Python Resources

We'll be using a little bit of Python in CS161. It won't be too intense, but here are some resources to help you get familiar with Python if you haven't seen it before.

  • Python 2 vs. Python 3. All examples and homework files in this class will be using Python 3 , which differs from Python 2 in a few important ways. (For example, integer division works differently). Here is a list of differences between Python 2 and Python 3.
  • Documentation: Python documentation is here.
  • Tutorials: A good tutorial for Python can be found here
  • In-line help: In the prompt in the Jupyter Notebook, if you type "help(x)" it will display a help page for x.
  • Jupyter: The pre-class exercise for Lecture 2 gives some info about how to install Jupyter with Python 3. tl;dr: Here is the Jupyter documentation, which tells you how to install Jupyter notebooks. Please install Python 3.
  • Have Python resources that you like? Let us know and we'll add them here!

Homework Resources

  • Guidelines: One of the big skills you'll be developing in CS161 is how to communicate technical material clearly. To that end, we expect homework sets in CS161 to be clear, and easily human-readable. Think of them like memos you might write to a colleague. Better still, think of them as memos that you might write for a team of colleagues, who may be working quickly and also who have control over your grade.

    Your homeworks should be typed and clearly written with complete sentences and well-organized logic, and should definitely not be your first draft.

    When we ask for pseudocode, we are expecting pseudocode that is clear enough that a CS106B student (and certainly the grader) can understand what your algorithm is doing, and could implement it in a language of their choice, without thinking too hard. It is good practice to include an English description of what your pseudocode is doing, to help out the reader. See the example homework before for good and bad examples of pseudocode.

  • Example HW: To help you get an idea of what we are expecting, here is an example of an appropriate solution to a CS161 homework set (a zip file that contains the PDF and LaTeX source, along with the files for the original problem set.)
  • HW Tips:
    • Look at the example above for style advice.
    • Try to put yourself in the position of the reader. If you hadn't just been thinking about this problem for several hours, would your answer make sense to you?
    • The homework questions will always end with a text block explaining what sort of answer we expect. Read this text block carefully.
    • Start the homework early.
    • Try to "finish" the homework early, step away from it for a day, and then come back to it and read it over again. Chances are, you'll find some way to write what you've written more clearly.
    • If you get stuck, then ask for help from the course staff: come to office hours prepared to explain what you have tried, and why you are stuck.
  • Homework Templates: For each HW assignment, we'll post a LaTeX template to get you started on typing it up.

SCPD Resources

Praneeth Kolichala (sunet ID pkolich) will be our dedicated SCPD CA, and SCPD students can email them about any particular concerns or accommodations. General questions about class material or homework should still be discussed on Ed. You can find a document outlining how to access course videos and other SCPD resources here.

  • Sections
    • One section will be recorded each week, and you can access the videos on Canvas alongside the lecture videos. (See the Sections page for more details).
    • SCPD students are always welcome to attend section in person as well!
  • Office Hours
    • Praneeth will be holding online office hours for SCPD students. Please see the Office Hours Schedule to find the SCPD office hour time slots the and Zoom link.

Other Resources