CS 112 - Introduction to CS II - Summer I, 2016


[Weekly Schedule | Lecture Schedule ]


Resources

Staff Contact Information

Instructor

Wayne Snyder
     Email: waysnyder@gmail.com

     Office: MCS 290
     Office Hours:
TBA
     Cell Phone: 617 - 966 - (210 + 41) (email vastly preferred)

Curriculum Assistants: TBA

 

 


Lecture Schedule

Back to Top

Lecture
Date
Lecture Topic
Readings (Java = "Java in a Nutshell")
Lecture Slides and Code Examples
Homeworks and Tests
Labs
1
M 5/23

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

Syllabus

Lecture 1: PDF

 

   
2
T 5/24 Introduction to Java: compiled languages (Java) vs interpreted languages (Python); types, operators, and expressions. Java statements, conditionals, and loops;

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

In Java, continue to read Chapter 2 through the material on if/then, while, for, break, and continue;

At LearningJavaOnline: go through exercises for

  • Hello World
  • Variables and Types
  • Conditionals
  • Loops

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

You could also look at the following lectures on the topics for today: Stevens YouTube videos: 10, 17,18, 25

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 2a: PDF

Lecture 2b: PDF (we will see how far we get with this)

HW 01: HTML

Solution to Part A: HTML

 
3
W 5/25 Java statements, conditionals, and loops; break and continue; arrays; methods and fields and the structure of basic Java programs. Scope of local variables, fields, and methods.

 

 

 

Used the board!

 

 
4 R 5/26

 

Java program structure continued: breaking a Java program into separate classes and separate files; more on scope (public vs private); static vs non-static members.

PlPlease 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

Read "Classes and Objects" and "Java File Structure" in the Java text.

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

Used the board! HW 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;

 

With this lecture, we will start to use our main textbook.

Please read

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

HW03: HTML

Part A Solution: HTML

Lab03: HTML
7 T 2/9          
8 R 2/11

Quicksort reviewed; Complexity Analysis of Recursive Sorts;

Abstract data types; OOD and Java program structure continued.

 

Used the board and Dr. Java and finish the last part of Lecture 6 (see link above).

Here are examples similar to the code I demonstrated in class, for the three types of Java files:

Original Program with all code in one file: StackDemoOriginal.java

Now here is the same program, broken into the three kinds of files:

HW04: HTML

Part A Solutions: HTML

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

Stack, Queues, and Priority Queues; Ring Buffers.

Error handling using Exceptions.

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

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

Read near the end of Chapter 2 in the Java book: "The Throw Statement" and "The Try/ Catch/Finally statement.

Lecture 9: PDF BW: PDF

HW05: HTML

Part A Solutions: HTML

Lab 05: HTML
10 T 2/23

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

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

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++).

Used the board!    
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: PDF BW: PDF

HW 06: HTML

Part A Solutions: HTML

Lab 06: HTML
12 T 3/1

Iterative LL algorithms

  Used the board!   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

Used the board!

No HW this week!

Here are some practice problems on Linked Lists: PDF

No Lab this week!
    SPRING BREAKEAK        
14

T 3/15

Recursive algorithms on LLs;

  Notes on Recursion and LLs

Used the board!    
             
  R 3/17 Midterm Exam  

Midterm Study Guide: HTML

Sample Midterm: PDF

Solution to Sample Midterm: PDF

Notes on Recursion in Java: HTML

HW 07: HTML

 

Lab 07: HTML

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

 BinaryTreeCode.html

Lecture 15: PDF    
16 R 3/24 BSTs continued

BinaryTreeCode.html

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

Lecture 16: Used the board!

HW 08: HTML

Part A Solution: HTML

Lab 08: HTML

17 T 3/29 Deletion from BSTs; Recursive tree traversals; Iterative tree traversals using an explicit stack  

Lecture 17: PDF

BW: PDF

 

 
18 R 3/31 2-3 Trees; B-Trees and external data structures Here is a good explaination of 2-3 Tree Insertions: YT

Lecture 18: PDF

BW: PDF

 

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

HW 09: HTML

Part A Solution: HTML

Lab 09: HTML
19 T 4/5 Array representation of binary trees; Binary Heaps, Heapsort

There are many videos about binary heaps, here is a good one: YT

MaxHeap.java

HowToImplementHashTables.html

Used the board!

 

 

 

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

Used the board!

  Lab 10: HTML
21 T 4/12 Hash Tables with Linear Probing; Performance of Hash Tables HashTableLP.java Used the board!    
22 R 4/14 Discussion of Homework 09  

Used the board!

 

 

 
23 T 4/19 Game trees: adversary search; implementation issues; example Tic-Tac-Toe program Reading on AI Techniques for Game Playing: PDF

Lecture 23: PDF

BW Lecture: PDF

 

 

HW 10 (Part B is group project): HTML

Part A Solution:

HTML

 
24 R 4/21 Alpha-beta pruning and refinements to game-tree search Video on Alpha-beta Pruning: YT

Lecture 24: PDF

 

   
25 T 4/26 Graphs: Basic notions, graph traversals: depth first, breadth first  

Lecture 25: PDF

Here is the set of slides on State Space Search (optional, not required for final exam): PDF

Search for "undirected graph" on YouTube, if you want to see some lectures, there are 1000's!

Practice Problems on Graphs: HTML

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

 

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

Back to Top

 

PDF

PPT