CS 112 - Introduction to CS II - Summer II, 2017

[Weekly Schedule | Lecture Schedule ]


Staff Contact Information


Wayne Snyder
     Email: waysnyder@gmail.com

     Office: MCS 290
     Office Hours: TBA

     Cell Phone: 617 - 966 - (210 + 41) (email vastly preferred)

Teaching Fellows: Minyang ("Mindy") Yan (myyan@bu.edu); Zingchen ("David") Zhou (xczhou@bu.edu)



Lecture Schedule

Back to Top

Lecture Topic
Readings (Java = "Java in a Nutshell", Eck = "Introduction to Programming in Java)
Lecture Slides and Code Examples
Homeworks and Tests
W 7/5

Overview of Course & Course Policies; Motivational Lecture: Two algorithms for searching an array---algorithm, implementation, analysis, and experiments; Introduction to Java: compiled languages (Java) vs interpreted languages (Python);

Java continued: Types, operators, and expressions.



You should read up through variables, types, and expressions in one of the two recommended texts.

Finally, here is an excellent online resource: at LearningJavaOnline: go through exercises for

  • Hello World
  • Variables and Types

Motivational Lecture: PDF

Java I: PDF


Part A Solution: HTML

Lab 1: HTML
R 7/6

Java statements, conditionals, and loops; break and continue;

Java arrays

Read Chapter 2 of Java up through while, for, break, and continue; also read about Array Types


Read Chapter 2 of Eck, sections 1 - 5 and Ch. 3, sections 1 - 5, 8, and Ch. 7 (at least the beginning).


At LearningJavaOnline: go through exercises for

  • Conditionals
  • Arrays
  • Loops


We will finish the Introduction to Java, and then cover:

Java II: PDF




Lab 2: HTML
F 7/7 Java continued: Methods and fields and the structure of basic Java programs. Scope of local variables, fields, and methods; Breaking a Java program into separate classes and separate files; Breaking a Java program into separate classes and separate files; more on scope (public vs private); static vs non-static members.

Please read about methods and Classes and Objects in the Java text;


Read Ch. 4 of Eck, sections 1 - 4.


Functions and Objects in JavaOnLine

Here are some additional Resources:

You can read about the difference between local and instance variables here: HTML

For scope of declarations, take a look at this set of notes: HTML


Java IV: PDF


Part A Solution: HTML

4 M 7/10

Creating and using (dynamic) objects; object-oriented design. Packages.

Lab: Testing and debugging


Reading as last lecture, plus "Packages and the Java Namespace," and "Java File Structure" in the Java text.


Java V: PDF

Summary of Java Program Structures: PDF


Part A Solution: HTML

Lab 3: HTML
5 T 7/11

Analysis of algorithms, "Big Oh" notation, experimental verification by timing analysis;

Interative sorting algorithms: Selection sort, Insertion sort

Complexity analysis of iterative sorts;



Here is a good Youtube tutorial on Selection Sort;

Here is a good one on Insertion Sort.

There are 1000's of Youtube lectures on sorting algorithms: here is a creepy visualization of Insertion Sort, and here is a downright strange visualization of Insertion sort.

Here is a nice Youtube mini-lecture on sorting, with associated lectures on all the major sorting algorithms.

Lecture: PDF





6 W 7/12

Recursive Sorting Algorithms: Mergesort

Complexity Analysis of Recursive Sorts

  Lecture: PDF Interfaces (this starts at p.117 in the Java book pdf available online)  

R 7/13


OOD and Abstract Data Types; Stacks and Queues

Reference types; Array Resizing


Read the section on Reference Types (pp.74-81) CAREFULLY in the Java Text.

Read the first half of the Wiki Article on Circular Buffers ("How it works" and look at the animated gif).

Lecture: PDF


Part A Solutions: HTML

8 M 7/17

Queues implemented as Ring Buffers

Deques and Priority Queues;

  Lecture: PDF


(due Friday 7/21 at midnight)

9 T 7/18

Linked Lists

Stacks and Queues with LLs.

Iterative Linked List Algorithms

Lab: Java Generics

Here is a very short, clear tutorial on Linked Lists: YouTube There are a number of such tutorials on YouTube, so look around a bit for others if you wish!

You might want to check out the classic Binky Pointer Fun video on YT, but bear in mind it is written for a different language (C or C++).

Notes on Iterative LL Algorithms

Lecture: PDF   Lab: HTML
10 W 7/19

Iterative LL algorithms; Recursion and the run-time stack.

Lab: Recursion

 Notes on Iterative LL Algorithms

Powerpoint slides on Exceptions: PDF


Used the board!


11 R 7/20 Recursive algorithms on LLs;


Notes on Recursion and LLs

Used the board!    
12 M 7/24


Summer 2 Midterm Solution: PDF


Midterm Average was 84; here is a histogram of the results.    
13 T 7/25

Recursion and LLs

Lab: Java Iterators

Here is an example of a simple exception: JAVA

Here is the Java Tutorial Page on Iterators: HTML

Also, look at this tutorial on Java Iterators: HTML

Here is an example of a simple iterator for an array-based data structure: JAVA


Used the board!


Part A Solution: HTML

(Due Th 7/27)

14 W 7/26

Binary Trees, Binary Search Trees; Searching, Insertion, and Deletion in BSTs.

Lab: Java Iterators




Lectures on Binary Search Trees: PDF1, PDF2

15 R 7/27

Algorithms on Binary Trees;

Recursive tree traversals; Iterative tree traversals using an explicit stack



Please read the following Wiki article on Tree Traversals: HTML and follow the link to read about breadth first search.



Part A Solution: HTML

(due T 8/1)

20 M 7/31 2-3 Trees; B-Trees and external data structures


Here is a good explanation of 2-3 Tree Insertions: YT

Here is a good animation you can play with to verify your understanding: HTML


Lecture: PDF    
21 T 8/1 The (nearly) Perfect Data Structure; Perfect Hashing, Hash Functions; Hash Tables with Separate Chaining

Reading on Hash Tables: PDF


Used the board! Practice exercises on hashing: HTML  
22 W 8/2

Linear Probing; Performance of Hash Tables

Double hashing

Resizing a hash table in linear time

Here is a Java implementation of a linear probing HT: JAVA Used the board!    
23 R 8/3

Final Exam



Back to Top