
Announcements
- This website is under construction and is still being updated for 2022.
- Each student in this course is expected to abide by the Cornell University Code of Academic Integrity. Any work submitted by a student in this course for academic credit must be the student’s own work.
Overview
Intermediate programming in a high-level language and introduction to computer science. Topics include object-oriented programming (classes, objects, subclasses, types), graphical user interfaces, algorithm analysis (asymptotic complexity, “big O” notation), recursion, testing, program correctness and loop invariants, searching/sorting, data structures (lists, trees, stacks, queues, heaps, search trees, hash tables, graphs), and graph algorithms. Java is the principal programming language.
Course Information
Time & Place
Lecture:
- Tuesdays and Thursdays, 10:10-11:00am, Statler Auditorium
You are expected to attend all lectures and one discussion each week. Cornell guidelines related to health must be followed.
Exams:- Prelim 1: September 20, 5:30-7:00pm (KND 116, RCK 201) or 7:30-9:00pm (BLY 101)
- Prelim 2: November 15, 5:30-7:00pm (KND 116) or 7:30-9:00pm (BLY 101)
- Final: December 14, 7:00-9:30pm (TBD)
Course Staff
Name/Position | Email/Phone | Office/consulting hours | |
---|---|---|---|
![]() |
Curran Muhlberger 462 Gates Instructor |
[mouse over for email]
|
Thu 11:15am-12:30pm, Gates 462 Mon 3-4pm, Gates 462 |
![]() |
Andrew Myers 428 Gates Instructor |
[mouse over for email]
(607) 255-8597 |
Thu 3-4pm, Gates 428 and Zoom |
Office Hours Weekly Chart
Day | Name | Time | Location |
---|---|---|---|
Monday | Curran | 3-4pm | Gates 462 |
Thursday | Curran | 11:15am-12:30pm | Gates 462 |
Andrew | 3-4pm | Gates 428 and Zoom |
TA office hours are held in Rhodes 405 unless otherwise specified.
Teaching Assistants
Section | TAs | NetIDs |
---|---|---|
DIS201 | Siqiu Yao | sy657 |
DIS202 | Dasha Griffiths & Diego Virtue | dkg39, dtv25 |
DIS203 | Sowmya Dharanipragada | sjd266 |
DIS204 | Emily Yu & Tomer Shamir | esy34, tys7 |
DIS205 | Benjamin Carleton | bc534 |
DIS206 | Siqiu Yao | sy657 |
DIS207 | Meghana Pothineni & Sowmya Dharanipragada | mp894, sjd266 |
DIS208 | Kyra Lee & Mena Attia | kl627, mma89 |
DIS209 | Nhan Tran & Angela Chao | nt322, ac2323 |
DIS210 | Benjamin Carleton & Mina Prapakamol | bc534, jp889 |
DIS211 | Maya Leong & Amy Cui | mfl74, yc2478 |
DIS212 | Amy Huang & Timur Beletskii | ach243, tab282 |
DIS213 | Xiangzhi Liu | xl829 |
DIS214 | Zhongqian Li | zl469 |
DIS215 | Tanvi Namjoshi | tkn24 |
DIS216 | Zhaoyu Wang | zw577 |
Prerequisites
Very good performance in CS 1110 or an equivalent course, or permission of the instructor. If you are unsure whether CS 2110 or CS 2112 is the right course for you, please talk to the instructor of either course. Both courses cover similar material and satisfy the same requirements, but CS 2112 covers material in more depth and has more challenging assignments.
Texts
You are expected to read the course notes posted on the web site. These will often contain more detail than what was presented in lecture.
Other Sources
-
• Prof. Gries’s Java HyperText has many online learning aids and tutorial videos, including introductory videos on Java and Eclipse.
- • Data Structures and Problem Solving Using Java, 3rd edition, Mark Allen Weiss, Addison Wesley, 2006. ISBN 0-321-32213-4. See also Weiss's website for additional material. A required text from previous years.
- • Program development in Java: Abstraction, Specification, and Object-Oriented Design, B. Liskov and J. Guttag, Addison-Wesley, 2000. ISBN 0-201-65768-6. An excellent source of material on designing and specifying abstractions.
- • Java Precisely, 2nd edition, P. Sestoft, MIT Press, 2005. To access the entire book for free, login via the Cornell Engineering Library.
- • Java in a Nutshell, 5th edition, David Flanagan, O'Reilly, 2005. ISBN 0-596-00773-6.
- • Effective Java, 3rd Ed., Joshua Bloch. Addison-Wesley, 2018. This book is packed with good programming advice and even agrees with what we will cover in class (mostly).
These titles will be on reserve in the Engineering Library (@ Uris Library).
Ed
We will be using Ed as an online discussion forum. You are encouraged to post any questions you might have about the course material. The course staff monitor the forum fairly closely and you will usually get a quick response. If you know the answer to a question, you are encouraged to post it, but please avoid giving away any hints on the homework or posting any part of a solution—this is considered a violation of academic integrity.
By default, your posts are visible to the course staff and other students, and you should prefer this mode so that others can benefit from your question and the answer. However, you can post privately so that only the course staff can see your question, and you should do so if your post might reveal information about a solution to a homework problem. If you post privately, we reserve the right to make your post public if we think the class will benefit. You can also post anonymously if you wish not to reveal your identity.
The discussion forum is the most effective way to communicate with the staff and is the preferred mode of interaction. Please reserve email for urgent or confidential matters. Free-ranging technical discussions are especially encouraged. Broadcast messages from the course staff to students will be sent using Ed and all course announcements will be posted there, so check in often.
See our office hours and consulting section below for additional notes regarding Ed Discussion.
CMSX
We will be using the course management system CMSX for managing assignments, exams, and grades. Everyone who preregistered for the course should be entered, but if you did not preregister, you are probably missing. Please login here and check whether you exist. There will be a list of courses you are registered for, and CS 2110 should be one of them. If not, please send your full name and Cornell netId to the Administrative Assistant so that you can be registered.
You can check your grades, submit homework, and request regrades in CMSX. Please check your grades regularly to make sure we are recording things properly. The system also provides some grading statistics. There is a help page with instructions.
Do not repost course materials released on CMSX publicly. These materials are intellectual property of Cornell and are meant for participants in the course. They are not free to the public.
Announcements and Handouts
Announcements will be posted to Ed. Homework and exam solutions will be available in CMSX. Check frequently for new postings.
Assignments & Exams
Unless otherwise specified, assignments may be turned in late with a penalty of 10% per day, up to 4 days late. Extensions may be granted in case of illness or other acceptable excuse; please contact the course instructor. Extension requests that arrive just before the deadline are less likely to be granted than extension requests that are made in advance. Start early on assignment so you have time to complete it despite the inevitable conflict with coursework from other classes. In addition, students have 4 slip days that they can use during the semester across all assignments. Unless otherwise specified, each assignment may use up to 3 slip days. Using a slip day removes the late penalty. Slip days will be used up automatically.
There will be one 1½-hour evening prelim and a 2½-hour final exam. Please check the schedule page for times and locations.
Your final grade will be based on your assignment and exam scores according to the following weights:
Participation | 5% | |
Lecture (iClicker) | 2.5% | |
Discussion (cooperative exercises) | 2% | |
Course evaluation | 0.5% | |
Quizzes | 10% | |
Assignments | 35% | |
Assignment 1 | 3% | |
Assignment 2 | 4% | |
Assignment 3 | 4% | |
Assignment 4 | 5% | |
Assignment 5 | 6% | |
Assignment 6 | 6% | |
Assignment 7 | 7% | |
Prelim 1 | 10% | |
Prelim 2 | 15% | |
Final | 25% |
Perfect attendance is not required to receive full participation credit. Responding to at least 3/4 of lecture questions and submiting at least 3/4 of discussion activities is sufficient. This provides flexibility to miss an occasional class for illness or a conflicting obligation without worrying about the impact on your grade. There are no make-up opportunities for participation credit; if you think you need to miss more than 25% of class meetings for legitimate reasons, discuss your situation with an instructor or advisor.
You will have two attempts to respond to each weekly quiz (note that the questions may be slightly different), and we will take your highest score. The quizzes are open-note, but they are timed and must be completed individually. Late submissions are not accepted, as questions will be discussed in discussion sections the following day. We will drop your lowest quiz score automatically to accommodate unexpected circumstances.
Regrades
Graded homework will be available on CMSX, and graded exams will be available on Gradescope. If you identify an error in how the rubric was applied to your assignment, you may submit a regrade request during the allowed window (typically within 1 week of an assignment being returned and within 2 days of an exam being returned). Errors not identified during the request window will not be corrected.
Regrade requests are submitted electronically in both CMSX and Gradescope. When submitting a request, explain precisely why the deduction does not apply to your solution. When evaluating a request, staff will review the entire question for grading accuracy and consistency, so it is possible for your score to decrease if errors in your favor are identified.
Academic Integrity
Each student in this course is expected to abide by the Cornell University Code of Academic Integrity. Any work submitted by a student in this course for academic credit must be the student’s own work.
The utmost level of academic integrity is expected of all students. Under no circumstances may you submit work done with or by someone else under your own name or share detailed proofs or code with anyone else except your partner. However, discussions about general techniques or the requirements of the assignment are permissible.
You must cite all sources, including Internet sources. You must acknowledge by name anyone whom you consulted (excluding course staff). You may not give nor receive assistance from anyone else during an exam. You may not give any hints or post any material that might be part of a solution publicly on Ed. If your question necessarily includes such material, post privately.
If you are unsure about what is permissible and what is not, please ask on Ed.
Academic Integrity Resources:
- • Cornell University Code of Academic Integrity
- • Computer Science Department Code of Academic Integrity
- • Explanation of AI Proceedings
Special Needs
We will provide appropriate accommodation for students with special needs or disabilities. Requests for accommodation are to be made during the first three weeks of the semester and must be accompanied by official documentation. Please register with Student Disability Services in 110 Ho Plaza (Cornell Health Building), Level 5 to document your eligibility.
Community of learning
We aim to create an inclusive learning environment where diversity and individual differences are respected and appreciated, and we expect students in this class to demonstrate diligence in understanding how others’ perspectives may be different from their own. Behaviors that contribute positively to our community of learning include:
- • Recognize that everyone is starting from different bases of knowledge. Be respectful and constructive when pointing out mistakes.
- • Listen to one another and, especially during group work, actively encourage everyone to contribute.
- • Help build a lively and active online learning environment. Ask and answer questions on our discussion board, always remembering to be respectful and constructive.
Copyright notice
All materials distributed in this course are copyrighted and may not be distributed further (unless otherwise indicated). They are intended for your sole use and may not be reposted on any public or private website or by any other sharing method (e.g. fraternity exam files). Public availability does not imply permission to redistribute, and materials on CMSX or Canvas are not even public to begin with.
You hold the copyright on original work you create for this course. But note that assignments include significant “skeleton” code authored by the course staff. Therefore, it is generally not permissible to share code for completed assignments. If you want to showcase your new skills in a portfolio, get creative and apply them in a novel setting.
Office hours and consulting
Through office and consulting hours offered by our course staff, you have many opportunities to get interactive assistance with course material from experienced peers and instructors who are dedicated to helping you learn. In general, you may bring almost any of your questions to any of the hours that fit your schedule. But the way different hours are run may make some better suited to certain kinds of questions than others (hence this guide). Note that offices tend to get crowded as deadlines approach, so you’re likely to get more personalized advice by getting an early start. Come early and come often—everyone is welcome!
TA office hours
All TAs’ office hours are open to all students (you are not restricted to the TA who teaches your discussion section). Office hours are able to accommodate small groups of students who may have related points of confusion; therefore, they are great for addressing high-level questions about course content (lectures & reading), past quizzes, lab exercises, and general approaches to assignments. If the session is quiet, the TA may be able to provide individualized assistance with debugging your assignment code, but priority will be given to assistance that can benefit everyone present. TAs may poll several students for questions and answer them out of order for the sake of efficiency.
Instructor office hours
Instructor office hours are just as open as TA office hours—please don’t hesitate to attend if they fit your schedule! Attending our office hours helps us get to know you, the students in our class (and enables us to write more personalized letters of recommendation). We make sure to schedule some hours immediately following Thursday lectures to host post-lecture Q&A while the material is still fresh.
As with TAs, we can accommodate a handful of students simultaneously and are happy to answer high-level questions about course content and assignments. We can also share related anecdotes from our experience applying these concepts in research and industry. If the session is quiet, we may be able to provide some individualized assistance or address more sensitive matters; however, if you require confidential consultation, please schedule an individual appointment.
Consulting hours
Consulting hours are dedicated to one-on-one assistance (or two-on-one if working with an assignment partner). Consultations are first-come, first-served, and you can add your name to the queue using the QueueMeIn web service. Our consultants have all taken a version of CS 2110 or 2112, so they can answer questions about material as well as assignments. Because of the one-on-one setting, consulting is the best way to get individualized assistance with assignment debugging.
Students should not expect more than 10 consecutive minutes of individualized attention during a consultation, as we need to keep the queue moving. Therefore, please come prepared with specific questions, having already read the lecture notes or assignment + skeleton code and attempted a design or test plan. Remember that consultants are not there to implement assignments for you, so expect to be asked to work independently and rejoin the queue even if consulting hours are quiet.
Ed Discussion
Don’t forget about our class discussion board! If you can phrase a precise question about where you are confused, or if you are curious about how a concept is generalized or applied, a public Ed post is a great way to get an answer, and reading and answering others’ posts is a great way to form connections among the material. Ed is also a good place for soliciting general computer troubleshooting advice or recommendations. We would prefer that students use Ed for all course-related chat rather than external services, as it engages the whole class and is moderated by trained staff.
Ed is not ideal for individualized debugging of assignments, however, as asynchronous iteration is tedious, there is no guarantee of a timely response, and your code cannot be shared publicly. Prefer consulting hours for individualized assistance (discussing general debugging strategies, on the other hand, is an excellent discussion board topic). Ed is also not the place to request personal accommodations; in general, if a consultant could not possibly address your situation, it is probably best directed to your TA or an instructor via e-mail (after reviewing the course policies).
Course Schedule
The schedule is still being updated and is subject to change.
Course notes can be viewed via links in the schedule, or as a table of contents or a single printable web page.
Lecture | Date | Topic/notes | Readings | Assignments, etc. | |
---|---|---|---|---|---|
1 | Aug 23 | Course overview discussion 1: Variables and IDEA [ handout ] |
[ Intro | Admin info | slides ] | ||
Object-oriented programming and interfaces | |||||
2 | Aug 25 | Objects, values, types, and scope | [ slides ] | ||
3 | 30 | Modularity and encapsulation | [ slides ] | Q1 due 8/29 | |
4 | Sep 1 | Subtyping and Java interfaces | [ slides | code ] | A1 due | |
5 | 6 | Inheritance | [ slides | code ] | Q2 due 9/5 | |
6 | 8 | Designing and documenting interfaces | [ slides ] | ||
7 | 13 | Modular design and testing | [ slides ] | Q3 due 9/12 (9/9 add deadline) | |
8 | 15 | Recursion and Linked Lists | [ slides | code ] | A2 due | |
9 | 20 | Exceptions and Prelim Review | [ slides | handout on I/O ] | Q4 due 9/19 | |
Sep 20 | Prelim 1 | ||||
10 | 22 | Parametric Polymorphism (Generics) | [ slides ] | ||
Algorithms and data structures | |||||
11 | Sep 27 | Asymptotic Complexity | [ slides | code ] | Q5 due 9/26 | |
12 | 29 | Trees | [ slides | code ] | A3 due | |
13 | Oct 4 | Hash tables discussion 7: Binary search trees [ handout ] |
[ slides | code ] | Q6 due 10/3 | |
14 | 6 | Loop invariants no discussion: Oct. 11 is a holiday |
[ slides ] | ||
Oct 11 | Fall break | ||||
15 | 13 | Simple sorting algorithms | [ slides | code ] | ||
16 | 18 | Recursive sorting algorithms | [ slides | code ] | A4 due, Q7 due 10/17 (10/17 drop deadline) | |
Software design and programming models | |||||
17 | Oct 20 | Design patterns: Models and Maybes | [ slides ] | ||
18 | 25 | GUI components: display and layout | [ slides | code examples ] | Q8 due 10/24 | |
19 | 27 | Event-driven programming | [ slides | demo code ] | ||
20 | Nov 1 | Concurrency | [ slides | examples ] | A5 due, Q9 due 10/31 | |
21 | 3 | Synchronization | [ slides | examples ] | ||
More data structures and algorithms | |||||
22 | Nov 8 | Graphs | [ slides ] | Q10 due 11/7 | |
23 | 10 | Graph traversals | [ slides ] | A6 due | |
24 | 15 | Topological sorting and prelim review | [ slides ] | Q11 due 11/14 | |
Nov 15 | Prelim 2 | ||||
25 | 17 | Dijkstra's shortest path algorithm no discussion next week (Thanksgiving break) |
[ slides ] | ||
26 | 22 | Priority queues and heaps | [ slides ] | Q12 due 11/21 | |
Nov 24 | Thanksgiving | ||||
27 | 29 | Balanced binary trees discussion 13: Heaps, A7 [ handout ] |
[ slides ] | ||
28 | Dec 1 | Interpreters, compilers, and JVM | [ slides | JVM specification ] | ||
Dec 5 | A7 due | ||||
Dec 5 | Q13 due | ||||
Dec 14 | Final Exam (7pm) |
Resources
- Course notes
- Java
- Interactive development environments (IDEs)
- Programming advice and resources
- Computer labs
- Support services
Course notes
Course notes for individual lectures and recitations can be found on the course schedule. The notes are also available as a single printable document.
Java
Java is one of the most widely used object-oriented programming languages, and programming skill in the Java language is in high demand. Nevertheless, this is not a course about Java. Java is simply a good vehicle for explaining many of the ideas on data structures, algorithms, and software engineering that will be covered in the course. Most of the ideas you will be exposed to in this course, and the skills you will develop, will transfer to other programming languages.
Online Resources
• The CS 2110 Java HyperText is a comprehensive collection of online modules introducing Java and Eclipse.
• The Java API contains documentation for the extensive Java class library.
• The Java Language Specification is helpful if you want to really understand how Java works.
• Oracle has an official Java Tutorial.
Brushing Up
Review the introductory chapters in the textbook and the Java reference books listed on the course info page. For students with C++ experience, check out this Wikipedia page comparing C++ with Java.
Java version
We will be using the Java 17 Standard Edition (Java SE 17) platform, which consists of the Java Development Kit (JDK) and the Java Runtime Environment (JRE). If you are using an earlier version of Java, please upgrade.
To find out which version of the JRE you are running, open a console window
(in Windows, right click the Start button and choose Windows PowerShell,
and in Mac OS, Applications > Utilities > Terminal)
and type java -version
at the command prompt:
$ java -version java version "11.0.4" 2019-07-16 LTS Java(TM) SE Runtime Environment 18.9 (build 11.0.4+10-LTS) Java HotSpot(TM) 64-Bit Server VM 18.9 (build 11.0.4+10-LTS, mixed mode)
This says I have version 11 installed.
If you are on a PC running Windows and have never installed a version
of the Java Development Kit (JDK) on your machine, you probably don't have it.
If you are on a Mac, you probably do. To find out, type javac -version
:
$ javac -version javac 11.0.4
If you get an error message or the version is earlier than 17, you must (re)install the JDK.
We recommend completely uninstalling any prior versions of the JRE or JDK before installing the latest one, to prevent problems later in the semester.
Installing the JDK
The JDK is already installed in CIT and ACCEL labs. However, installing it own your own machine will greatly facilitate your work.
To download the JDK, visit Oracle's Java web site and download and install the appropriate version of the JDK for your platform.
Compiling and Running from the Command Line
Compiling: Say your main class is MyProgram
and it is
contained in the source file MyProgram.java
.
If it is not in a package, navigate
to the folder containing MyProgram.java
and type javac MyProgram.java
. If it is in a package (say myPackage
), the
source should be in a folder called myPackage
. Navigate
to the folder containing myPackage
and type javac myPackage/MyProgram.java
.
Running: From the same folder you compiled from, type
java MyProgram <program arguments>
if it is not
in a package, and java myPackage.MyProgram <program arguments>
if it is.
Specifying a Classpath: Sometimes you may need to inform Java where to find auxiliary
classes. You can do this with the -cp
option
to the java
command.
Supply a sequence of folders telling Java where to look
for classes, separated by :
(Mac) or
;
(Windows).
Local Software
Some Java libraries have been developed for use in CS 2110 and CS 2112 assignments. Feel free to use them.
EasyIO
: Support for easy console input and output, and for scanning
input from a file or string (like java.util.Scanner
, but more powerful).
[ doc | jar | source ]
Maybe
is a better version of the Option pattern, developed for the
CMSX project. The Option pattern is provided by Java in
the class java.util.Optional
, but Maybe
throws a checked exception,
which makes it both more foolproof and more efficient.
[ doc | jar | source ]
cs2110
: Various types of queues, including a priority queue supporting in situ adjustment of priorities;
a DelimitedStringBuilder similar to one found in OCaml; a module that runs an external script that takes a
string on stdin and writes a string to stdout; and a module for easy access to a text resource file.
[ doc | jar | source ]
IDEs
IDE stands for integrated development environment. The use of an IDE is the best way to develop Java programs. IDEs provide many valuable aids such as syntax checking, debugging, and refactoring that can save you a lot of effort.
There are many good IDEs. We recommend IntelliJ, but you may use any one that you like, or none at all. IntelliJ is installed in all the labs. Early recitation sections will get you started with IntelliJ if you are not familiar with an IDE.
Here are some links:
You should follow the 2110 style guide for naming conventions and code format. IntelliJ users can download and install the IntelliJ style template used by the course staff. A legacy Eclipse style template is also available.
Programming
There are many valuable resources that can help you take your programming skills to the next level. Here are a few links:
General
Software Development Methodologies
Debugging
Just for Fun
- Please Don't Learn to Code
- Teach Yourself Programming in Ten Years
- Quines (Self-Reproducing Programs)
- Powers Of Ten
- Programming Quotes
- How To Write Unmaintainable Code
- History of Operator Precedence
- Software Bugs & Glitches
- Doom for System Administration
- The International Obfuscated C Code Contest
- The Easter Egg Archive
- OOP Criticism
- Esoteric Programming Languages
Computer Labs
CIT Labs
Cornell Information Technologies (CIT) runs several computer labs across campus for all members of the Cornell community. The JDK and Eclipse are installed on these machines. Check here for locations and times of operation.
ACCEL Lab
You can also find the course software in the Academic Computing Center (ACCEL), located in the Engineering Library in Carpenter Hall. Any CS student may register for an account.
Support Services
Other Support Services
PROGRAM | DESCRIPTION |
---|---|
Registrar's Office | General services for the Cornell community. |
Engineering College | Support services for Engineering students. |
Arts College | Support services for Arts students. |
CIT | Services offered by Cornell Information Technologies (CIT), including computer training. |
Cornell Health | The Cornell University Health Service Center. For all health related concerns and counseling services. |
Learning Styles | Not everyone learns the same way. If you are curious about how you learn, check out this collection. |
Assignments
All source code will be available on CMSX.
Assignment 1 | Java warm-up |
Assignment 2 | CMSμ |
Assignment 3 | CSV Join |
Assignment 4 | PhD Genealogy Tree |
Assignment 5 | Game Search and Hash Tables (JavaDoc) |
Assignment 6 | Click-a-Dot (JavaDoc) |
Assignment 7 | McDiver |
Other resources for programming assignments:
- Nothing yet.