Caution! You are looking at an out-of-date version of this website from Spring 2020.
To access the current version, click here.


Description. This course is an introduction to computer science in the context of scientific, engineering, and commercial applications. The goal of the course is to teach basic principles and practical issues, while at the same time preparing students to use computers effectively for applications in computer science, physics, biology, chemistry, engineering, and other disciplines. Topics include: programming in Java; hardware and software systems; algorithms and data structures; fundamental principles of computation; and scientific computing, including simulation, optimization, and data analysis.

Prerequisites. None.

Textbook. R. Sedgewick and K. Wayne, Computer Science: An Interdisciplinary Approach, Addison–Wesley Professional, 2016. ISBN 978-0134076423. We will be referencing this text all semester. The lectures are based on its contents. (Labyrinth)

Video lectures. Studio-produced lecture videos are available here.


Below you will find our contact information, though you'll likely get a faster response by posting on our course forum, found on the Help page.

Prof. Sedgewick

Dr. Alan Kaplan
Teaches P10

Dr. Soohyun Nam Liao
Teaches P01 and P13

Dr. Dan Leyzberg
Teaches P02 and P07A

Dr. Jérémie Lumbroso
Leads Assignment Grading

Javed Aman
Teaches P10A and P11

Zhongqiao Gao
Provides Exam Accommodations

Suriya Kodeswaran
Teaches P03 and P07

Anastasiya Kravchuk-Kirilyuk
Teaches P05 and P14

Jennifer Lam
Teaches P06 and P08

Priscilla Lee
Teaches P04 and P12

Sonali Mahendran
Facilitates Discussion on Ed

Johan Ospina
Checks Grading Consistency

Xin Sun
Checks Grading Consistency

Graders. Abhinav Agarwal, Addie Jung, Adrian Tong, Al Liang, Alex Luo, Alexander Bechtold, Allison Chou, Alyssa Lau, Amanda Vera, Anaika Mehra, AnneMarie Caballero, Anoopkumar Sonar, Anton Stengel, Ava Crnkovic-Rubsamen, Begum Ortaoglu, Benjamin Herber, Byron Zhang, Carina Beat, Cheyenne Zhang, Chiara Nilsson-Salvati, Claire Du, Connie Xu, Dangely Canabal, Diamond Acharya, Eduardo Fernandez, Eileen Wang, Elizabeth John, Gabriel Contreras, Gabriel Grajeda, Gemma Zhang, Geoffrey Zheng, Grace Liu, Grace Xu, Handa Chun, Hanna Xu, Haoyuan He, Henrique Schechter Vera, Hetvi Patel, Ian Jaccojwang, Ivy Wang, Jana Saber, Jasmin Gao, Jeanna Joseph, Jeremy Pulmano, Jessica Fan, Joseph Lou, Julia Douvas, Juliet Oh, Kaelix Johnson, Kartik Shah, Ken Nakamura, Kevin Lin, Khemet Robinson, Kwan Sirisakunngam, Lois Wu, Melody Zheng, Monique Legaspi, Morgan Teman, Nick Padmanabhan, Pang Nganthavee, Rohan Jasani, Saisha Agrawal, Sara Schwartz, Shannon Heh, Shayna Maleson, Sophie Li, Srija Patcha, Tara Cubeisy, Thomas Dhome-Casanova, Yuewen Wu, Yuxi Zhen.


Precepts meet twice per week, on either Tuesdays & Thursdays or Wednesdays & Fridays. We offer four precept formats, varied by length and teaching style.

We offer two lengths: 50-minutes and 80-minutes. Both are designed for students with no previous coding experience. Both cover the same material, but the 80-minute format allows more time to ask questions and learn at a more relaxed pace.

We offer two teaching styles: traditional precept and self-paced precepts. Traditional precept is taught in a classroom teaching model with hands-on exercises and activities. Self-paced precepts cover the same material but focuses even more on your own hands-on experience. In a self-paced precept, you will explore concepts to learn with a partner while following through step-by-step instructions. Preceptors will facilitate your exploration by answering to your questions whenever necessary.

Length Teaching Style Precept
50 minutes Traditional P02, P03, P05, P06, P07, P07A, P08
50 minutes Self-Paced P01, P04
80 minutes Traditional P10, P14
80 minutes Self-Paced P10A, P11, P12, P13

If you miss your precept, you can attend any other precept section. All Tuesday and Wednesday precepts cover the same content; all Thursday and Friday precepts cover the same content. We ask that you email the other preceptor in advance to let him/her know that you're coming.


Course software.This course has an associated software package called introcs that provides a complete Java programming environment. Install it on your computer by following the instructions for your operating system: Mac OS X, Windows, or Linux.

Ed Discussion. Ed Discussion is an online forum where you can ask and answer short questions.

Booksite. The booksite is a resource that accompanies the textbook for use while online (for example, while programming); it contains the code from the book and solutions to selected exercises. The textbook is for your use when initially learning new material or reinforcing your understanding of that material (for example, when reviewing for an exam).

codePost. You can check your assignment and programming exam feedback and grades on codePost.

Workstation computers.For students who may not have a computer or for students whose computers fail during the semester:


Course grades. Course grades are based on nine weekly programming assignments (40%), two written exams (35%), two programming exams (15%), and a final programming project (10%). There is no curve: you must earn, at a minimum, 93.0% of the available points for an A, 90.0% for an A–, 87.0% for a B+, 83.0% for a B, 80.0% for a B-, 77.0% for a C+, 73.0% for a C, 70.0% for a C-, or 60.0% for a D. You will fail the course if you earn below 60.0% of the available points.

Midterm exams. There are two two-part exams during the semester. One pair will be given in the middle of the semester; the other pair in the last week or so of classes. The exams have a written portion and a programming portion. There is no final exam. No makeup exams will be considered without a Dean's recommendation and our approval in advance.

Programming assignments. There are nine weekly programming assignments, all equally weighted.

Final project. The final project is a large programming project, approximately the length of two weekly assignments. It is due toward the end of Reading Period.

Late work. Assignments are due on Monday nights at 11:59pm. Submissions made at 12:00am will be marked late. If any part of an assignment is submitted late, the entire assignment will be marked late. To submit an assignment late, mark the checkbox on our online submission system (i.e., TigerFile) that indicates that your work is incomplete. If the deadline has passed and the checkbox is not marked, we will grade submitted work as-is. We will not accept any work after Dean's Date without a Dean's recommendation.

Penalties for late work. Late assignments are assessed a penalty equal to 20% of the possible points on the assignment per day or partial day late. The penalties for your first four late days are automatically waived. Additional late penalties will be waived only in the case of unforeseeable circumstances like medical emergencies, as documented by your Dean or Director of Studies.

Regrades. If you feel we have made a mistake while grading your work, write a short note describing the potential mistake and attach it to the graded work. Return it to your preceptor within two weeks of the work being handed back.

Collaboration Policy

This course permits (and encourages) many forms of collaboration, including with course staff, classmates, and lab TAs. However, you must be careful to collaborate only as authorized below. Here is an executive summary:

COS 126

Your solutions. You must individually compose all of your solutions. The term solutions refers to any of the products created when completing a programming assignment, such as source code (including comments) and the readme.txt file. It includes both finished and unfinished products, regardless of correctness or completeness.

All the rules above continue to apply after assignments are graded and after the end of the semester.

Collaboration with course staff. You are welcome to discuss your solutions with course staff members (instructor and preceptors) in office hours or via private Ed Discussion posts. Do not post or email us your code; instead, submit it via the course submission system.

Collaboration with classmates. We encourage you to discuss common concerns with classmates either private via personal interactions or publicly in the Ed Discussion course forum. These discussions must be kept at a general level, without exposing your solutions.

For example, you may discuss: But, you may not:
  • How to interpret an error message. For example, "What does StackOverflowError mean?"
  • How to use a feature in IntelliJ. For example, "How do I start the emmbedded terminal?"
  • Clarifications for the lecture videos, lecture slides, textbook, old exam questions, or the assignment specifications.
  • Look at another classmate's solutions (or show another classmate your solutions).
  • Lead a classmate step-by-step through any part of the assignment (or allow a classmate to lead you step-by-step through any part of the assignment).

Collaboration with students who have already taken COS 126. Anyone who successfully completed COS 126 in a previous term, including lab TAs and peer tutors, may assist you in the following ways:

Collaboration with a partner. On certain assignments the collaboration policy is relaxed to allow working with a partner, subject to the following rules:

Collaboration acknowledgment. You must acknowledge all collaboration in the readme.txt file for that week's assignment.


Plagiarism and abetting plagiarism are serious academic infractions. Programming is a creative work and the academic regulations that apply to plagiarizing prose also apply to plagiarizing code. Princeton's Rights, Rules, Responsibilities defines plagiarism as "the use of any outside source without proper acknowledgment." It ranges from "verbatim copying" (e.g., cutting-and-pasting code) to "thorough paraphrasing" (e.g., changing variable names or rearranging code).

Outside sources and citations. Copying or adapting code that is not yours is permitted only if it comes from the course materials (i.e., the course textbook, companion booksite, programming assignment specifications, checklists, lecture slides, lecture videos, and precepts). If you do so, you must cite any code that you copy or adapt (with the exception of code that is included with the assignment).

Plagiarism detection. We use sophisticated software tools to detect plagiarism. For example, we compare each submission (including interim submissions) against a code database, which includes all submissions from this offering and previous offerings of the course. While we take no pleasure in bringing cases to the Committee on Discipline; it is our duty to keep the playing field level for the overwhelming majority of students who work very hard in this course and follow the rules.

Penalties. We refer alleged academic violations (including plagiarism and abetting plagiarism) to the Committee on Discipline. If found responsible, the typical penalty is an F as a course grade plus whatever penalty that the CoD imposes. (The typical CoD penalty for plagiarism is suspension from the University for one year.) Violators of course policies that are not adjudicated by the CoD will receive penalties based on the severity of the violation, ranging from a warning (for violations that are both unintentional and innocuous) to an F in the course (for violations that are both intentional and serious).