CS 112 - Introduction to CS II - Fall 2016


[Resources | Staff Contact Information | Course Schedule ]


Resources

Staff Contact Information

Quick Links

Piazza Discussion Forum

Tutoring and Office Hours Schedule

Homework Submission and Grading Policies

Quick Start Guide to Dr. Java

Dr. Java User Documentation

Learning Java Online

Aaron Stevens YouTube Lectures on Java

The Java Tutorials

Java Style Guidelines for CS112

Course Syllabus

Policy on Collaboration

Useful Links

 

Instructor

Wayne Snyder
     Email: waysnyder@gmail.com
     Office: MCS 290
     Office Hours: W & R, 3:00 - 6:00pm
  

Teaching Fellows:

Gautam Bhat  (gautam@bu.edu) (lab sections A2,A3,A4)

Daniel Valentine (dval@bu.edu) (lab sections A5,A6,A7)

Course Assistants and Labs

  • A2 (Thurs 2-3): Chloe Fortuna (cfortuna@bu.edu)
  • A3 (Thurs 3-4): Tyrone Hou (tyroneh@bu.edu)
  • A4 (Thurs 4-5): Viviana Yee (vivyee@bu.edu)
  • A5 (Thurs 5-6): Amalia Safer (asafer@bu.edu)
  • A6 (Thurs 6-7): Ben Gaudiosi (gaudiosi@bu.edu)
  • A7 (Thurs 7-8): Sean Smith (swsmith@bu.edu)

 

 

Professor Snyder

Gautam Bhat

Daniel Valentine

 

 



Course Schedule

Back to Top

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

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

Syllabus: HTML

Lecture 1: PDF

 

   
2
R 9/8 A first look at Java: compilation vs interpretation, expression-oriented vs statement-oriented, basic program structure, assignments, values, expressions, types

Install Dr. Java from the www.drjava.org and from the Help menu (or using the link above in Quick Links), go to the Quickstart and read part 3: "Using Dr. Java, The Basics."

[Optional: Look at the following short YouTube video by Aaaron Stevens, one of our 111 instructors: 01]

For Mac Users: During install 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."

Read Chapter 2 of Java until you get to Increment and Decrement Operators on p. 35. NOTE: this is a reference book, and you do not need to know every picky little detail about every operator. Please read through with an eye for the big picture, and use the following resources to supplement as needed:

[Optional: At LearningJavaOnline: go through exercises for

  • Hello World
  • Variables and Types]

[Optional: Look at the following (short) YT videos by Professor Stevens: 02, 03, 05, 08]

 

 

Lecture 2: PDF

HW01:HTML (due W 9/14)

Part A Solution: HTML

 

Lab 01:HTML
3 T 9/13

Finish expressions, increment and decrement operators.

Control Structures: if, if-else, while, for, break and continue;

Continue to read Chapter 2 in Java about the following:

Operators: Increment and Decrement Operators; Boolean Operators; Assignment Operator;

Statements: Expression Statements, Compound Statements, Empty Statement, local variable declaration statements; if/else; while; for; break; continue; return.

[Optional: At LearningJavaOnline: go through exercises for

  • Conditionals
  • Loops]

[Optional: Look at the following lectures: 09 (review of casting from last time), 10, 18, 21, 22

Lecture 3: PDF    
4 R 9/15

Arrays; Defining and using methods;

Continue to read Chapter 2 in Java about the following:

  • Arrays (pp. 70-73 in online pdf of Java book)
  • Methods

[Optional: At LearningJavaOnline: go through exercises for

  • Arrays
  • Functions]

[Optional: Look at the following YT lectures: 25, 26, 4, 12]

Lecture 4: PDF

HW 02: HTML (due W 9/21)

Part A Solution: HTML

Lab 02: HTML
5 T 9/20 Program Structure, Local variables vs fields; Scope of fields; the keyword static. Classes vs objects; creating (non-static) objects.

Read the section "Objects and Classes" (starting on p.66) in Java but skip the section "Object Literals", and ALSO the sections "The Members of a Class" and "Creating and Initializing Objects" (starting on p.88 of the online pdf).

[Optional: At LearningJavaOnline: go through exercises for

[Optional: Look at the following YT videos: 30a, 30b, 30c ]

Lecture 5: PDF    
6 R 9/22 Creating and using objects; the keywords public and private; Object-Oriented Design; Abstract Data Types.

Read section "Data Hiding and Encapsulation" but skip the section on "Access Control and Inheritance" and don't worry too much about the issues about "packages" (basically, a package is a folder/directory where code is stored).

[Optional, but an excellent summary: Read through section 2.12 here: HTML.]

 

Lecture 6: PDF HW 03: HTML (due W 9/28) Lab 03 (Debugging Strategies): HTML
7 T 9/27

Stacks and Queues as ADTs; implementing Stacks and Queues using arrays.

Reference types: How are the variables for arrays and objects different than for primitive types?

Strings and reference types; String comparison using equals(...) compared with ==.

Fixing a big problem with stacks and queues: Array resizing

 

 

Here is a short (3:40) and simple YT video about Stacks and Queues: HTML.

[Optional: Look at the Wikipedia entries on Stacks and Queues.]

Read Java section on "Reference Types" but stop when you get to "Terminology: Pass by Reference."

 

Lecture 7: PDF

Code from lecture: Stack.java

   
8 R 9/29 Implementing Queues with Ring Buffers.

Read about "Circular Buffers" on Wikipedia: HTML.

Lecture 8: PDF   Lab 04: Polymorphic ADTs; Generic classes;
9 T 10/4

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

Introduction to sorting: Iterative sorts: Insertion & Selection Sort;

Complexity analysis of iterative sorts.

 

 

  Lecture 9: PDF    
10 R 10/6

Recursive sorting: Mergesort; Recursive sorting: Quicksort;

Complexity analysis of recursive sorts

  Lecture 10: PDF   Lab 05: Interfaces
  T 10/11 Monday Schedule -- No Class        
11

R 10/13

Introduction to Linked Lists; Stacks and Queues with LLs Notes on Iterative LL Algorithms Lecture 11: PDF    
12 T 10/18 Basics of List Processing: Iterative Algorithms Notes on Iterative LL Algorithms Lecture 12: PDF    
13 R 10/20 Recursive algorithms on LLs

  Notes on Recursion and LLs

Lecture 13: PDF    
14 T 10/25 Recursive algorithms on LLs

  Notes on Recursion and LLs

Lecture 14: PDF    
15 R 10/27 Binary Trees, Binary Search Trees; Searching and Insertion in BSTs.

 BinaryTreeCode.html

Lecture 15: PDF    
16 T 11/1 Deletion from BSTs; Recursive tree traversals; Iterative tree traversals using an explicit stack

BinaryTreeCode.html

Please read the following WikiP article on Tree Traversals: HTML

Lecture 16: PDF    
17 R 11/3 2-3 Trees; Tree traversals using parent pointers (lab)

Lecture 17: PDF

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

   
18 T 11/8 2-3 Trees concluded; B-Trees and external data structures Please look at the following Wiki Article: HTML (and follow the link to read about breath-first search) Lecture 18: PDF    
19 R 11/10 Array representation of binary trees; Binary Heaps, Heapsort

MaxHeap.java

HowToImplementHashTables.html

Lecture 19: PDF    
20 T 11/15 The (nearly) Perfect Data Structure; Perfect Hashing, Hash Functions; Hash Tables with Separate Chaining   Lecture 20: PDF    
21 R 11/17 Hash Tables with Linear Probing; Performance of Hash Tables HashTableLP.java Lecture 21: PDF    
22 T 11/22     Lecture 22: PDF    
  W 11/23 Thanksgiving Break        
23 T 11/29     Lecture 23: PDF    
24 R 12/1     Lecture 24: PDF    
25 T 12/6     Lecture 25: PDF    
26 R 12/8     Lecture 26: PDF    
  Sat 12/17 Final Exam        

Back to Top