CS 112 - Introduction to CS II - Spring 2015

[Resources | Staff Contact Information |Course Schedule ]


Staff Contact Information

Tutoring and Office Hours Schedules:   

  • Weekly Schedule for CS 112: JPG
  • Tutoring Hours Staff: JPG

Piazza Link



  • Midterm Solution Key A: PDF
  • Midterm Solution Key B: PDF


Wayne Snyder
      Email: waysnyder@gmail.com

     Office: MCS 147
     Office Hours: T 2:30-4:30 (see here for my office hours for general CS issues)
      Cell Phone: 617 - 966 - (210 + 41) (email vastly preferred)

Teaching Fellows:

Wenxin Feng (wenxinf@bu.edu) (lab sections A2, A3, A7, A8)

Baichuan Zhou (baichuan@bu.edu) (lab sections A4, A5, A6, A9)

Course Assistants and Labs

  • A2 (Thurs 2-3): Amalia Safer (asafer@bu.edu)
  • A3 (Thurs 3-4): Kyle Mann (kmann@bu.edu)
  • A4 (Thurs 4-5): Mahir Gulrajani (mahirkg@bu.edu)
  • A5 (Thurs 5-6): Andrew Tarrh (atarrh@bu.edu
  • A6 (Fri 9-10): Beth Becker (bethb42@bu.edu)
  • A7 (Fri 11-12): Monica Martin (monicamm@bu.edu)
  • A8 (Thurs 6-7): Viviana Yee (vivyee@bu.edu)
  • A9 (Fri 3-4): Sridevi Suresh (sridevis@bu.edu)



Professor Snyder

Wenxin Feng

Baichuan Zhou

Course Assistants: Andrew, Amalia, Kyle, Viviana, Beth, Srivedi, Monica, and Mahir

Course Schedule

Back to Top

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

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




R 1/22 Introduction to Java: compilation vs interpretation, expression-oriented vs statement-oriented, and types.

Read Ch. 1 of Java; and start to look at Ch. 2 up through expressions


Used the board and Dr. Java!



Part A Solution: HTML

Lab 01: HTML
T 1/27 Snow Day!    


3 R 1/29 Java continued: increment and decrement operators, control structures Continue to read Chapter 2 through the material on increment/decrement operators (++ and --) and control structures (emphasize if, while, and for) Used the board and Dr. Java!


Part A Solution: HTML

Lab 02: HTML
4 T 2/3

Finishing loops: break and continue; Array literals (how to initialize an array); Defining a static class; The words static, public, & private; Defining and using methods; Local variables vs fields; Scope of variables and fields

Please read through the next couple sections of the textbook, on defining methods, on the array data type, and on defining classes, but STOP when you get to the part about defining objects using the word new.  Used the board and Dr. Java!    
5 R 2/5 Defining objects (non-static classes); Read the sections in the textbook on "Creating Objects" and "Using Objects" Used the board and Dr. Java!


Part A Solution: HTML

Lab03: HTML
  T 2/10 Snow Day!.        
6 R 2/12 Object-Oriented Design   Lecture 6: PDF


Part A Solutions: HTML

Lab04: HTML
  T 2/17 No class -- Monday schedule        
7 R 2/19

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

Fixing a big problem with stacks and queues: Array resizing

Implementing Queues with Ring Buffers.

Read textbook section on "Array Types" (most of this you already know), and first subsection of "Reference Types" on "Copying Objects and Arrays";

Optional: Read about "Ring Buffers" on Wikipedia

Lecture 7: PDF


Part A Solutions: HTML

Lab 05: HTML
8 T 2/24 Polymorphic ADTs; Generic classes; Introduction to sorting: Iterative sorts: Insertion & Selection Sort;


Lecture 8: PDF   Here is a nice Youtube mini-lecture on sorting, with associated lectures on all the major sorting algorithms.
9 R 2/26

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

Complexity analysis of iterative sorts;

Recursive sorting: Mergesort


  Lecture 9: PDF


Part A Solutions: HTML

Lab 06: HTML
10 T 3/3

Recursive sorting: Quicksort;

Complexity analysis of recursive sorts

  Lecture 10: PDF   Last day to drop a class without a "W" on your transcript.
11 R 3/5 Introduction to Linked Lists; Stacks and Queues with LLs Notes on Iterative LL Algorithms Lecture 11: PDF No HW this week! 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!

T 3/17

Basics of List Processing: Iterative Algorithms Notes on Iterative LL Algorithms Lecture 12: PDF    
  W 3/18 Midterm Review Session        
  R 3/19 Midterm Exam    


Part A Solution: JAVA

Lab 07: HTML

Please read pp.55-59 in the textbook before the lab.

14 Sat 3/21 Recursive algorithms on LLs

  Notes on Recursion and LLs

15 T 3/24 Recursive algorithms on LLs

  Notes on Recursion and LLs

16 R 3/26 Binary Trees, Binary Search Trees; Searching and Insertion in BSTs.


Lecture 16: PDF


Part A Solution: HTML

Lab 08: HTML
17 T 3/31 Deletion from BSTs; Recursive tree traversals; Iterative tree traversals using an explicit stack


Please read the following WikiP article on Tree Traversals: HTML

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

Lecture 18: 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


Part A Solution: HTML

Lab 09: HTML (Tree traversals using parent pointers)

Friday 4/3 is last day to drop with a "W".

19 T 4/7 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)      
20 R 4/9 Array representation of binary trees; Binary Heaps, Heapsort



    No lab this week!
21 T 4/14 The (nearly) Perfect Data Structure; Perfect Hashing, Hash Functions; Hash Tables with Separate Chaining    

HW 10: HTML (MiniGoogle)

Part A Solution: HTML

22 R 4/16 Hash Tables with Linear Probing; Performance of Hash Tables HashTableLP.java     Lab 10: HTML (Performance of hash functions)
23 T 4/21 Game trees: adversary search; implementation issues; example Tic-Tac-Toe program Reading on AI Techniques for Game Playing: PDF

Lecture 23: PDF

Example: TicTacToe.java

24 R 4/23 State-space "puzzle" search, recursive backtracking  

Lecture 24: PDF




Optional HW 11: HTML (Team project: game)

Code Distribution for HW 11: ZIP

No more labs!
25 T 4/28 Alpha-beta pruning and refinements to game-tree search        
27 R 4/30 Last Lecture: Conclusions, Wrap-up, and Course Evaluations        
  T 5/5 Final Exam Review Session        
  W 5/6 Final Exam        
  F 5/8 noon Extra HW due        

Back to Top