CS 161 Piazza Algorithms Illuminated CLRS

Resources

Piazza

Sign up for Piazza here

  • We will try to answer questions in a timely fashion; but be aware that we have to sleep too. (Do NOT count on Piazza for last-minute homework help!!!)
  • You can answer your peers' questions! That would be awesome!

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-$20-ish in print).
  • 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

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. (They also allow you to share your LaTeX with others; but of course you won't be needing that feature for this class!) 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 two 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 Template: If you don't want the full-blown example homework above, here's a bare-bones LaTeX template you can use. We will also post the PSET source code so you can borrow LaTeX code from the problem statements.

SCPD Resources

Arjun (sawhneya) will be our dedicated SCPD CA, and SCPD students can email him about any particular concerns or accommodations. General questions about class material or homework should still be discussed on Piazza. You can find a detailed document outlining the SCPD and remote student logistics for this course here.

  • Sections
    • The Thursday 3:30-4:20pm section (in Gates B01) will be recorded each week, and you can access the videos on Canvas alongside the lecture videos.
    • SCPD students are always welcome to attend section in person as well!
  • Office Hours
    • Arjun will be holding online office hours for SCPD students. Please see here to find Arjun's online office hour time slots. To connect to online office hours, follow these instructions:
      • 1) Create a Zoom meeting
        • go to Zoom's website here
        • click on "Launch Zoom"
        • click on "Host a meeting"
        • a pop-up window might open: click on "Open zoom.us"
        • another pop-up window might open: click on "Join With Computer Audio"
        • your Zoom meeting has been created, and a Zoom meeting window should appear
      • 2) Get the invitation URL of your Zoom meeting
        • in your Zoom meeting window, click on "Copy URL"
        • Note: if you do not see "Copy URL", you may need to first click on "Invite Others" (and then click "Copy URL")
      • 3) Go to Queue Status here
      • 4) Sign up for the queue: add your name and the invitation URL of your Zoom meeting on Queue Status. Please also provide a very short description of your question (e.g. "HW3 problem 3 (a)" or "Lecture 2 Big-O notation").
      • 5) Wait in line, until it is your turn. When it is your turn, Arjun will join your Zoom meeting!

Other Resources

  • CS161 alum Sushil Upadhyayula has assembled a great list of places around the internet which offer alternate takes of CS161 material. Everyone learns differently: if the official course materials aren't doing it for you (or even if they are), check out these other resources! (Thanks Sushil!)
  • If you need a pick-me-up.