CS 112 - Introduction to CS II - Spring 2016

[Weekly Schedule | Lecture Schedule ]


Staff Contact Information


Wayne Snyder
     Email: waysnyder@gmail.com

     Office: MCS 276
     Office Hours:
T 2:30 - 3:30; W 1:30 - 4:30
     Cell Phone: 617 - 966 - (210 + 41) (email vastly preferred)

Teaching Fellows:

Alex Breen (abreen@bu.edu) (lab sections A2, A3, A4, A9)

Mike Breslav (breslav@bu.edu) (lab sections A5, A6, A7, A8)


Lecture Schedule

Back to Top

Lecture Topic
Readings (Java = "Java in a Nutshell")
Lecture Slides and Code Examples
Homeworks and Tests
T 1/19

Overview of Course & Course Policies; Motivational Lecture: Two algorithms for searching an array---algorithm, implementation, analysis, and experiments


Lecture 1: PDF BW: PDF


R 1/21 Introduction to Java: compiled languages (Java) vs interpreted languages (Python); types, operators, and expressions.

Read Chapter 2 of Java up through "Expressions and Operators"

At LearningJavaOnline: go through exercises for

  • Hello World
  • Variables and Types

Install Dr. Java from the Dr. Java Web Site and from the Help menu, read through the Tutorial on "Using Dr. Java, The Basics," OR look at the following YouTube video by Aaaron Stevens, one of our 111 instructors: YT

If you get the message "'Dr Java.app' is damaged and cannot be opened. You should move it to the trash," go to System Preferences > Security & Privacy and change the "Allow apps" to "Anywhere."

Lecture 2: PDF BW: PDF

HW01: HTML (due W 1/27 9pm)

Part A Solution: HTML

Lab 01: HTML
T 1/26 Java statements, conditionals, and loops; break and continue; methods; arrays.

In Java, continue to read Chapter 2 through the material on if/then, while, for, break, and continue; then read the section on methods, and skip ahead and read about arrays, just the about creating, using, and array literals (used to initialize).

There are lots of different kinds of statements, but for now we just need the basic ones.

LearningJavaOnline: go through exercises for

  • Conditionals
  • Loops
  • Arrays

YouTube videos: 10, 17,18, 25


Lecture 3: PDF BW: PDF


4 R 1/28

Methods and parameters;

Instance variables ("fields") vs local variables;

Scope and lifetime of declarations.


Please read about methods in the Java text; please read about the difference between local and instance variables here: HTML

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

In LearningJavaOnline: go through exercises for: Functions

YouTube video: 12

Used the board!


Part A Solution: HTML

Lab 02: HTML
5 T 2/2

Analysis of algorithms, "Big Theta" 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 5: PDF B&W: PDF    
6 R 2/4

Recursive sorting: Mergesort Recursive sorting: Quicksort;

Complexity analysis of recursive sorts

Here is a good Youtube video on Mergesort, and one on Quicksort.

The first video uses "Big Oh" notation O(...) instead of "Big Theta" notation, but they are basically the same.

There are several versions of quicksort, with subtle differences; the one above uses the exact method I will use in class, so please look at that one!

Lecture 6: PDF B&W: PDF


Part A Solution:

Lab03: HTML
7 T 2/9

Quicksort reviewed; Complexity Analysis of Recursive Sorts;

Object-Oriented Design; Java program structure; static vs non-static; breaking a program into separate files.

Please read "Classes and Objects" and "Java File Structure" in the Java text.

Look at Aaron Stevens' YouTube videos 30a, 30b, 30c.

Lecture 7:    
8 R 2/11

Abstract data types; OOD and Java program structure continued. Stacks, queues, and priority queues.

Read the introduction to the Wiki articles on stacks: HTML and queues: HTML

Lecture 8:


Part A Solutions:

  T 2/16 No class -- Monday schedule        
9 R 2/18

Polymorphic data types; Generic classes;

Inheritance, interfaces, and abstract classes


Lecture 9:


Part A Solutions:

Lab 05:
10 T 2/23

References and pointers; fixing a problem with array data types: array resizing; introduction to Linked Lists.


Lecture 10:    
11 R 2/25

Stacks and Queues with LLs.

Basics of List Processing: Iterative Algorithms

Notes on Iterative LL Algorithms

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!

Lecture 11:

HW 06:

Part A Solutions:

Lab 06:
12 T 3/1

Iterative LL algorithms

  Lecture 12:   Last day to drop a class without a "W" on your transcript.
13 R 3/3 Recursive algorithms on LLs

  Notes on Recursion and LLs

Lecture 13: No HW this week! No Lab this week!

T 3/15

Recursive algorithms on LLs

  Notes on Recursion and LLs

Lecture 14:    
  W 3/16 Midterm Review Session        
  R 3/17 Midterm Exam    

HW 07:

Part A Solution:

No Lab this week!


15 T 3/22 Binary Trees, Binary Search Trees; Searching and Insertion in BSTs.


Lecture 15:    
16 R 3/24 Deletion from BSTs; Recursive tree traversals; Iterative tree traversals using an explicit stack


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

Lecture 16:   Lab 07:
17 T 3/29 2-3 Trees;

Lecture 17:

Here is a good explaination of 2-3 Tree Insertions: YouTube

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

HW 08:

Part A Solution:

18 R 3/31 2-3 Trees concluded; B-Trees and external data structures   Lecture 18:   Lab 08:
19 T 4/5 Array representation of binary trees; Binary Heaps, Heapsort



Lecture 19:

HW 09:

Part A Solution:



20 R 4/7 The (nearly) Perfect Data Structure; Perfect Hashing, Hash Functions; Hash Tables with Separate Chaining  

Lecture 20:

  Lab 09:
21 T 4/12 Hash Tables with Linear Probing; Performance of Hash Tables HashTableLP.java Lecture 21:    
22 R 4/14 Game trees: adversary search; implementation issues; example Tic-Tac-Toe program Reading on AI Techniques for Game Playing: PDF

Lecture 22:

Example: TicTacToe.java


HW 10:

Part A Solution:

Lab 10:
23 T 4/19 Alpha-beta pruning and refinements to game-tree search and Course Evaluations  

Lecture 23:

Practice Problems in MinMax and AlphaBeta pruning: PDF

24 R 4/21 Graphs: Basic notions, graph search  

Lecture 24:


  No labs rest of semester!
25 T 4/26 Graphs: Topological sort  

Lecture 25:


26 R 4/28 Graphs; Comments on Final Exam; Course Evaluations  

Lecture 26:

  T 5/3 Final Exam from 12:30 - 2:30        

Back to Top