Computer Science 151

Principles of Computer Science II

Spring 2017



Bob Geitz, King 223A


Office Hours:

MWF 11-12, Thursday 1:30-3, or by appointment

I am around most of the day when I am not in class.


The content picks up where 150 left off, but the expectations are significantly higher. We will use Java rather than Python, and you will be expected to pick up the Java language quickly. You will find the labs are longer and require more thinking. You will need to read the textbook. This is the course where you will start to become more professional in the way you approach programming questions. Our senior majors report that on job interviews the bulk of the questions they are asked deal with material covered in 151.


Data Structures & Problem Solving Using Java (Fourth Edition) by Mark Allen Weiss; Addison Wesley, 2010. You should read almost all of this over the course of the semester.


Exams and Grading:

We will have 2 in-class exams during the semester and a comprehensive final exam. Here is how the grades for the course will be composed:

Note that the final exam will be Wednesday, May 10 at 7 PM. This time is set by the Registrar and I cannot change it for the class or for individuals. If you have issues with this time you should talk to the Dean of Studies immediately.

The Labs and Prelabs

We will have labs and prelabs, similar to the 150 labs and prelabs. Each week the lab sessions will be on Monday and Tuesday; the labs will be due by 6PM on the following Sunday. The prelabs will be due in class on Monday. I will not accept late prelabs. They don't count for that much of your grade, so if you are sick and miss one it isn't the end of the world. If something prevents you from coming to class on a Monday you can email me your prelab; you need to do that by noon. Keeping up with the labs is even more important in this class than it was in 150. You will find it very difficult to do the work of a lab until you have completed all of the previous labs. Because of this, we have the following rather complex lateness policy for the labs:

  1. Late labs that are handed in by 9AM on Monday morning are docked 10%.
  2. Late labs that are handed in by 6PM on Wednesday are docked 50%.
  3. We won't accept labs more than 3 days late.
  4. However, you have 3 Late Lab Exceptions that allow you to hand in a lab up to 3 days late (i.e, up to Wednesday at 6PM) without penalty. To use such an exception, include a text file in the folder you are handing in, with file name LateLabException.txt. The body of this file should say "This is my 1st (or 2nd or 3rd) exception." Note that these exceptions cover any reason for being late with your work, from "I was sick over the weekend" to "My dog ate my laptop."

Many of the labs allow partners. On a partnered lab you may (you are not required to) work with one other partner on the entire lab. If you do this, the two of you should hand in only one copy of your solutions, with the names of both partners clearly indicated. It is an Honor violation to hand in joint code as your own. On all labs you are welcome, even encouraged, to work with a partner during the 2-hour lab session. If you are not completing the lab with your partner, at the end of the lab session you should each take a copy of the joint code and finish it on your own. In this case you should indicate who you started the code with, but that you finished it on your own.


There are lots of ways to get help with this class. One is by talking to me. I am around just about all day Monday-Friday. You can talk to me outside of my posted office hours, but it might help to let me know you are coming. In addition to the student helpers during the lab there are also evening and weekend lab helpers who can help you with the labs.

The Honor Code

The Honor Code has a straightforward application to this class. On all of the exams you are responsible for your own work; you may neither give nor receive any information during the course of the exam. If someone takes an exam at a different time than the rest of the class there may be no communication concerning the exam between that person and anyone else in the class, not even whether the exam was easy or difficult. The atmosphere is much more relaxed for the lab assignments. You may discuss the labs, including details of the programming code, with anyone else in the class, but in the end you must write your own code. Or if you are working with a partner, you and your partner must write and sign the code you hand in. Making a copy of someone else's code and handing it in as your own, even if you change the names of the variables in the program, is a violation of the Honor Code. You should be learning to think structurally about code, so talk to anyone about functionality and then write the code yourself.

Course outline:

Week Day Topic/Reading HW/Labs
Week 1

January 30

Course Overview.
Python to Java
Find and bookmark Java4Python
Read Java Bootcamp
Read text, Chapter 1

Lab 0: Introduction to Eclipse
Feb 1-3

Types and Classes
Read text, Chapters 2 and 3

Week 2 Feb 6-10

Java I/O

Prelab 1
Lab 1: Java-ing Around

Java Collections classes. Abstract classes
Read text, Chapter 4, Sections 6.2 to 6.5, and Chapter 15

Week 3 Feb 13-17

Implementing ArrayLists.

Prelab 2
Lab 2: MyArrayList

Sorting and Searching. Stacks and Queues
Read text, Chapter 5, Sections 8.1 to 8.3, Chapterl 16

Week 4 Feb 20-24

Algorithm Analysis
Read text, Chapter 5

Prelab 3
Lab 3: Stacks and Queues
Read text, Chapter 7
Week 5 February 27 Linked Structures
Read text, Chapter 17
No lab this week
March 1 Review for Exam 1

March 3

Exam 1
Week 6 March 6-10 More on linked structures.
Read text, Chapter 18
Prelab 4
Lab 4: Linked Structures (Partners optional)
Week 7 March 13-17 Balanced Trees
Read text, Chapter 19
Prelab 5
Lab 5: Binary Trees
Week 8 March 27-31 Maps and Sets

Prelab 6
Lab 6: AVL Trees (Partners optional)

Priority Queues
Read text, Chapter 21

Heaps and HeapSort

Week 9 April 3-7 Hashtables
Read text, Chapter 20
Prelab 7
Lab 7: Search Engine (this is a continuation of Lab 6)
Week 10 April 10-14 Graphs: Terminology and Representation
Read text, Sections 14.1, 14.2
Prelab 8
Lab 8: Hashing (Partners optional)
Week 11 April 17 Graphs: Shortest Path
Read text, Section 14.3

Prelab 9

Lab 9: Boggle (Partners optional)

April 19 Review for Exam 2
April 21 Exam 2
Week 12 April 24-28

Dijkstra and Bellman-Ford Alorithms
Topoligical Sorting
Read text, Sections 14.3 to 14.5

Prelab 10

Lab 10: Kevin Bacon Game (Partners optional

Week 13 May 1-5 Spanning trees and their applications
Read text, Chapter 24


Final Exam: Wednesday, May 10, 7 PM