CSE116: Computer Science 2

Summer 2024

Jump to current week
YouTube Watch lecture (Live and VOD)
Autolab Submit programming assignments
GitHub Example Code examples shown in lecture slides
Tracing Tool Memory Diagram Tracing Tool
Memory Diagrams Memory Diagram Reference
Piazza Ask questions and find office hours
Discord Chat with other students


Course Description

You know the basics of programming. You're proficient in variables, functions, control flow, data structures, and file IO. With these concepts, you can train a computer to complete nearly any task you can imagine. So what's next?

Writing large programs

You will learn how to write and organize large pieces of software. To this end, in CSE116 you will study:

  • Unit Testing
  • Classes and Object-Oriented Programming (OOP)
  • Data Structures & Algorithms

While studying these topics we will have a focus on how your programs work, not just that they work.


This is not an easy course! To do well in this course you are expected to:

  • Invest a minimum of 12 hours/lecture* in CSE116 including at least 9 hours/week outside of class
  • Want to learn about computer science (This is assumed since you are taking a second CSE course)
  • Understand the basics of programming
  • Stay up-to-date with the course content (You are expected to fully understand the content of every lecture before the next lecture begins

* The 12 hour minimum is an average. If you invest less than 12 hours/lecture in CSE116 early in the semester, or do not fully understand all the CSE115 topics, you should expect to work significantly more than 12 hours/lecture while you catch up. You should expect to spend 50+ hours in a single week on this course alone if you fall behind or if you're not comfortable with the CSE115 material. Do not fall behind.

CSE115 Review

If you did not take CSE115 at UB, or would otherwise like to review the material, below are some CSE115 resources to help you get caught up:

Keep in mind that you must understand the concepts of CSE115 and be prepared to apply them to the syntax of a new language (Java). You will not be required to write Python in CSE116.

Specifically, you are expected to understand the concepts of variables, expressions, functions, conditionals, loops, memory diagrams, and reading CSV files.

Learning Objectives

Being successful in CSE116 requires completion of all of the learning objective requirements. You must complete every Learning Objective requirement in order to pass CSE116.

Learning objectives are divided into 2 primary categories:

Classes/Object-Oriented Programming (OOP)

Instead of writing programs as a collection of variables and functions, with object-oriented programming we will group these variables and functions into classes and objects. This allows developers to reason about their programs at a higher level of abstraction.

A student has completed this objective if they are able to:

  • Read/Quiz: Trace through the execution of programs that use classes, inheritance, and polymorphism while tracking the state of stack and heap memory using memory diagrams
  • Write: Write programs and testing that use classes, inheritance, and polymorphism

Data Structures & Algorithms

We will study several new approaches for storing data and computing with that data. Primarily, we will see linked-lists, trees, and graphs while exploring applications of each data structure.

A student has completed this objective if they are able to:

  • Read/Quiz: Trace through the execution of programs that use linked-lists and trees using memory diagrams
  • Write: Write programs and testing that use linked-lists, trees, and graphs as well as implement new algorithms to expand the functionality of each data structure

Learning Objective Completion

To complete the learning objectives of this course, you must complete all of the following requirements.

  • Quiz x2
    • There are 2 quiz requirements that must be completed during the semester.
      1. OOP Quiz
      2. Data Structures Quiz
    • Quizzes will be completed during midterm and/or final exam and will assess your ability to trace through stack and heap memory during the execution of provided code.
    • These quizzes are graded on a pass/fail basis. If you pass the quiz, you have completed the learning objective portion of that quiz. All completion decisions will be made by a human after reviewing your submission.
    • Both the midterm and final exam with consists of both the OOP and Data Structures quiz. This provides you with 2 opportunities to complete each quiz. If you pass a quiz on the midterm, you do not have to retake it on the final exam. If oyu pass both quizzes on the midterm, you do not have to take the final exam.
    • The midterm and final with both contain 2 programs to trace for each quiz. This means that for each quiz (OOP and Dat Structures) you will have a total 4 opportunities to complete a trace for that quiz. If you pass any of he 4 traces, you will have completed that learning objective (Meaning that there are 8 total traces that you can complete. You must pass 1 OOP trace and 1 Data Structures trace to pass the course.)
  • Write - Programming Tasks x8
    • There are 8 learning objective programming tasks assigned throughout the semester. To complete the write portion of the learning objectives, you must complete all 8 programming tasks.

Learning Objective Requirements Completed Grade
All 8 Programming Tasks and 2 Quizzes Grade depends on the number of Application Objectives completed
Less than all Programming Tasks all Quizzes F

Application Objectives

If you have completed all of the learning objectives, your grade will be determined by the number of application objectives you've completed. Most application objectives are designed to incentivize you to keep up with the material of the course and are not meant to be overly difficult to earn. Your final letter grade will be determined as follows:

Application Objectives Completed Grade
20-24 A
18-19 A-
16-17 B+
14-15 B
12-13 B-
10-11 C+
8-9 C
6-7 C-
4-5 D+
0-3 D

Application Objectives

Falling even 1 week behind in this course will significantly increase your chances of failing. Application Objectives offer you incentives to stay up-to-date on the material by giving you chances to improve your letter grade.

  • Programming Task Expected Deadlines x16
    • Each of the 8 programming tasks have 3 separate deadlines. Completing all tasks before the earliest deadline will earn you a total of 16 application objectives. These deadlines are:
    • Expected Deadline: The expected deadline is the morning (8am) 2 days after the material for the task was covered in lecture (This is lass than 48 hours. The summer moves extremely fast!). The intent is that you are expected to complete the task before the next lecture begins. As the name implies, this is when you are expected to be able to complete the task if you are keeping up with the course. Each time you complete a task before it's expected deadline, you will earn 2 application objectives
    • Late Deadline: The late deadline is the morning (8am) 5 days after the material for the task was covered in lecture. Complete a task before this deadline to earn 1 application objective. This allows you a second chance to still earn an application objective even if you are failing behind in the course. If you are consistently relying on the late deadlines, you are at risk of failing the course and must work hard to catch back up.
    • Final Deadline: The final deadline is the night (11:59pm) 11 days after the material for the task was covered in lecture. You must complete all 8 tasks before their late deadlines, or you will fail the course. This means that if you miss any of the 8 final deadlines, you will fail regardless of your performance throughout the rest of the course. Students who fall behind enough to need to use a final deadline are often too far behind to have any chance of catching back up. This deadline removes any false hope you may have of catching up after falling so far behind. Meeting this deadline will not result in any application objectives.
  • Quizzes x8
    • There are 4 total traces on the midterm exam. For each trace that you pass on the midterm, you will earn 2 application objectives
    • The final exam gives you a second chance to pass the class via 4 more traces, but you will not earn any application objectives if you needed to use the final exam


There is no textbook for this course. Instead, links to relevant readings and tutorials are provided in the course schedule. When a reading is listed you should study it before lecture.

Academic Integrity

CSE Department Academic Integrity Policy:

UB Academic Integrity Policy:

In addition to the department and university policies, the following details apply to this course.

All submitted work must be of your own creation, and you must not share your submission with anyone else. If any submission is very similar to code that has been submitted by another student, or can be found online, it is in violation of this course's academic integrity policy, and all students will be penalized whether they were copying or sharing their code with other students so they can copy. If two submissions are similar beyond what is likely if the students worked independently, then both students are in violation of the academic integrity policy.

All violations will result in:

An F in CSE116.

It is your responsibility to understand what constitutes an academic integrity violation. If you have any question whether something you are doing is a violation or not, ask for clarification before receiving an F in the course. I will not entertain excuses after you have been caught.

Examples of acceptable behavior:

  • Discussing an assignment with your classmates and brainstorming abstract solutions, then writing the code independently
  • Forming study groups and discussing course material and assignments on Discord, Zoom, etc.
  • Searching the Internet for supplementary material on the course topics
  • Asking the teaching staff for clarification on a homework question
  • Having, or hiring, someone to help you understand the concepts of the course

Examples of unacceptable behavior:

  • Pressuring a TA to falsify an interview report.
  • Submitting code, or other work, for course credit that is not your own.
  • Collaborating with another student to complete an assignment. <-- This is the most common type of violation. DO NOT write code together!
  • Using Artificial Intelligence to help you write code.
  • Allowing another student to see your code or submission for an assignment.
  • Allowing another student to access your work that will be submitted for course credit. (Examples: Do not post you code publicly, host your code in a public repository, allow a classmate to access your laptop, leave your laptop unsecured, let a friend/roommate borrow your laptop containing your code, etc.)
  • Having someone help you write code.
  • Hiring someone to write code for you.
  • Copying a large amount of material found on the Internet into your submission.
  • Attempting to access the grading code on Autolab.
  • Asking any of the course staff to falsify your grade (eg. Asking for any result that you did not rightfully earn).

If you plan on cheating, plan on taking this course again.

Lecture 1: Introduction to Java
May 28
Course Introduction

Introduction to Java - Slides

Java Loops and Conditionals - Slides
Lecture 2: Introduction to Java
May 30
Java Data Structures - Slides

Java Examples
Lecture 3: Testing 1 - Unit Testing
Programming Task 1: Unit Testing
June 4
Unit Testing - Slides

Testing Strings/doubles - Slides

Testing and Recursion - Slides
Lecture 4: Classes/OOP 1 - Classes
Programming Task 2: Classes
Thursday, June 6 @ 8:00am
Task 1: Expected Deadline
June 6
Classes and Objects - Slides

Classes and Objects - Slides

Testing Classes and Examples - Slides
Saturday, June 8 @ 8:00am
Task 2: Expected Deadline
Sunday, June 9 @ 8:00am
Task 1: Late Deadline
Lecture 5: Data Structures 1 - Linked Lists
Programming Task 3: Linked Lists
Tuesday, June 11 @ 8:00am
Task 2: Late Deadline
June 11
Linked List Structure - Slides

Linked List Algorithms - Slides

Stack and Queue - Slides
Lecture 6: Classes/OOP 2 - Inheritance
Programming Task 4: Inheritance
Thursday, June 13 @ 8:00am
Task 3: Expected Deadline
June 13
Inheritance - Slides

Inheritance and Override - Slides

Sorting with Comparators - Slides
Saturday, June 15 @ 8:00am
Task 4: Expected Deadline
Saturday, June 15 @ 11:59pm
Task 1: Final Deadline
Sunday, June 16 @ 8:00am
Task 3: Late Deadline
Lecture 7: Data Structures 2 - Trees
Programming Task 5: Trees
Monday, June 17 @ 11:59pm
Task 2: Final Deadline
Tuesday, June 18 @ 8:00am
Task 4: Late Deadline
June 18
Binary Trees and Traversals - Slides

Binary Search Trees (BSTs) - Slides

Binary Tree Examples
Lecture 8: Midterm Exam, then Testing 3 - Testing and Files
Programming Task 6: Files
Thursday, June 20 @ 8:00am
Task 5: Expected Deadline
June 20
Midterm Exam - First 1.5 hours of lecture
June 20
Files and Exceptions - Slides

Testing With Files
Saturday, June 22 @ 8:00am
Task 6: Expected Deadline
Saturday, June 22 @ 11:59pm
Task 3: Final Deadline
Sunday, June 23 @ 8:00am
Task 5: Late Deadline
Lecture 9: Classes/OOP - Polymorphism
Programming Task 7: Polymorphism
Monday, June 24 @ 11:59pm
Task 4: Final Deadline
Tuesday, June 25 @ 8:00am
Task 6: Late Deadline
June 25
Polymorphism - Slides

Polymorphism - Slides

Polymorphism Example
Lecture 10: Data Structures 3 - Graphs
Programming Task 8: Graphs
Thursday, June 27 @ 8:00am
Task 7: Expected Deadline
June 27
Graphs - Slides

Graph with BFS - Slides

Graph Examples - Slides
Saturday, June 29 @ 8:00am
Task 8: Expected Deadline
Saturday, June 29 @ 11:59pm
Task 5: Final Deadline
Sunday, June 30 @ 8:00am
Task 7: Late Deadline
Lecture 11: Final Exam
Monday, July 1 @ 11:59pm
Task 6: Final Deadline
Tuesday, July 2 @ 8:00am
Task 8: Late Deadline
July 2
Final Exam - The entire 2.5 hours of lecture
Saturday, July 6 @ 11:59pm
Task 7: Final Deadline
Monday, July 8 @ 11:59pm
Task 8: Final Deadline

Website GitHub Website GitHub