Bryn Mawr College
CMSC 206: Data Structures
Fall 2015
Course Materials
Prof. David Cooper

Information
Texts  Important Dates  Assignments  Schedule Course Policies Links

General Information

Instructors:

David G. Cooper
249 Park Science Building

dcooper1 at brynmawr dot edu
http://cs.brynmawr.edu/~dgc
Office Hours: drop in if the door is open, or by appointment

Lecture Hours: Tuesdays & Thursdays, 2:25 to 3:45pm
Room: Park 349 <--- Note the room change!
Open Lab: Thursdays, 12:00pm to 2:00pm in Room 231 (additional lab hours are also available, see below)

Laboratories:

Lab Assistants: The following Lab assistants will be available during the week (names and schedules will be posted by the end of this week) for assistance on lab assignments.

Ziting Shen, zshen @ bmc, Sundays 6:00pm to 10:00pm Rachel Xu, rxu1 @ bmc, Mondays and Wednesdays 7:30pm to 9:30pm


Texts & Software

Data Structures: Abstraction & Design Using Java, 2nd Edition by Elliot B. Koffman & Paul A. Wolfgang, Wiley 2010. Source code and more at the Companion Site. Available at the Campus Bookstore for $164.50. Also at amazon for $104.17 (much lower options also available) click here.

JDK 7/8 (Java Development Kit) + Eclipse for Java Developers.
This software is installed in the lab computers. You may install it on your own computers. To get JDK, click here (be sure to get the JDK - Java SE Version) and to get Eclipse click here (again, be sure to get Eclipse for Java Developers). Follow the installation instructions provided. There will be no support provided for installations on your personal machines.
http://www.eclipse.org/downloads/

 


Syllabus

Course Description (from the Course Catalog): Introduction to the fundamental algorithms and data structures using Java. Topics include: Object-Oriented programming, program design, fundamental data structures and complexity analysis. In particular, searching, sorting, the design and implementation of linked lists, stacks, queues, trees and hash maps and all corresponding complexity analysis. In addition, students will also become familiar with Java’s built-in data structures and how to use them, and acquire competency in using a professional grade IDE.

Here is what we plan to learn this semester:


Important Dates

Sept. 1: First lecture
Oct. 1: Exam 1
Nov. 3: Exam 2
Dec. 10: Last lecture/Exam 3


Assignments

  1. Assignment#1 (Due on Tuesday, Sept 8): Click here for details.
  2. Assignment#2 (Due on Thursday, Sept 17): Click here for details.
  3. Assignment#3 (Due on Tuesday, Sept 29): Click here for details <--- Note: Updated/Corrected Extra Credit description! .
  4. Assignment#4 (Due on Thursday, Oct 8): Click here for details.
  5. Assignment#5 (Due on Tuesday, Nov 10): Click here for details.
  6. Assignment#6 (Due on Tuesday, Nov 24, Tuesday, Dec. 1): Click here for details.


Schedule (subject to change, check here for updates)

Week

Date

Topic

Reading

Assignments

Comments

1

09/01

Introduction
_________________

  • administrivia
  • Looking at data
  • data abstractions
  • structures
  • algorithms, etc.

K&W:

  1. Appendix A (skim, then read pgs. 679-681 carefully)
  2. Ch. 1
_________________

Start: Assignment 1
Grading: Assignment#1 will be graded based on the CS110 Grading Policy.  
___________________

Sample Processing code: The_USPS_Volume_Processing_program (without the data). <--- look at this example to see how to read a file and turn it into arrays of numbers for plotting. It will help for Assignment 1! If you'd like, you can get the data from here.

Python Graphics Library: Visit this page if you need information on doing simple graphics in Python.
 

09/03

Java Basics
_________________
Java vs. Processing, program structure, basic input/output, simple dialog-based I/O, Data types and variables, constants, type conversion, reference variables

Slides from 2013:

  1. Welcome/Intro
  2. Java Basics

Appendix A (Read A.1 and A.2 carefully, skim A.3-A7, drill down when interested.)

Start: Lab 1  
_________________
Personal computer setup: The only necessary tools needed to work on your own computer are the java development kit and an editor (I suggest you use Emacs, Look here for which to download).
Here is a guide from 2013 on Java Development

Please remember: This is an intro course. There is no question that is too basic. We all understand that not everyone in the class has been breathing code all summer long. In fact most of us have not.

If you have questions about Assignment1, please email me as soon as they arise. You can keep trying to figure it out, but I may be able to point you in the right direction.

To convert the copied text from the data link above, here is a Processing sketch with the data copied and pasted with each value on a line by itself. You can

  1. run the sketch and then copy the output and paste it into a spreadsheet program;
  2. then format the cells of the second column in the spreadsheet to be generic
  3. There is one cell that has -- that will need to be changed to a 0 before you export the spreadsheet as a csv;
  4. rename the csv file to USPSData.txt and put it in the Data directory of your example sketch that you copied from Sample Processing code: The_USPS_Volume_Processing_program

Java code example from class:
Part 1 Part 2

2

09/08

Diving into Java
___________________
arrays, statements, methods - class methods, JOptionPane I/O.

Appendix A (Read A.8 to A.11 carefully)

Submit: Assignment 1
Start: Assignment 2

<--- please submit Assignment 1 to Moodle, even though it's late, and even though you submitted a paper copy in class.

Lab 1 notes: If you are unfamiliar with Unix, and you are using a Mac or the Lab computers, you may find this link a good place to start.
If you are using Windows, then when you use the CMD prompt that is DOS, so this link may be a good place to start.
Example code:
ReviewClass.java

09/10

Java Cont.
file I/O in Java using the Scanner class, error detection and correction: exceptions, try-catch blocks exceptions and exception handling, Instance methods, 


Submit: Lab 1
Start: Lab 2  

Class Example Files:
ScannerExamples.java

Unix and Emacs Commands

3

09/15

Rosh Hashanah


 

 

09/17

Objects and Classes
File I/O and exception handling examples. Doing object-oriented programming (OOP) in Java. Designing classes (basic UML), writing code to implement classes. Deliberating about public and private prefixes in class design. Examples. Inheritance in OOP.


Submit: Assignment 2
             Lab 2
Start: Assignment 3  Grading: Assignment#3 will be graded based on the CS206 Grading Policy and coding standards.

 

Class Example Files:
PrintWriterExample.java

Place.java
School.java (inherits from Place)

Fraction.java (unfinished)

Exercise: Create a driver program that instantiates and uses each of the example classes above (Place, School, and Fraction).

4

09/22

More Classes
Recursive vs. Iterative solutions (gcd vs. gcdIter in Fraction2.java) OOP in Java. Designing classes. Composition in OOP. Example: Cup and Contents classes

K&W: Chapter 1.

Start: Lab 3

 

Class Example Files:
RecursiveMethods.java
Fraction2.java

Cup.java (Depends on Contents)
Contents.java

Exercise: Implement a coffee date in the main of Cup.java to ask for the drink type and drink size of two people and then instantiate the cups based on the order and print out the result.

09/24

Basic Data Structures DynamicArray vs. LinkedList, ADTs and Interfaces in Java, packages, generics

K&W: Chapter 2

 

 

5

09/29

ADT Implementation.
The Java Collections Framework (an introduction). The ArrayList class in Java. Under the hood: implementing your own list class (using fixed size arrays). Implementing our own List ADT: Version 1 (Using fixed size arrays).

K&W: Chapter 2

Submit: Assignment 3/ Lab 3 Report
Start: Assignment 4


<--- Note: Updated/Corrected Extra Credit description for Assignment 3!

Grading: Assignment#3 will be graded based on the CS206 Grading Policy and coding standards.

Class Example Files:
SimplifiedList.java
ArrayListFixed.java

 

10/01

Exam 1


 

 

 

6

10/06

Computational Complexity.
______________________
CPU speeds (FLOPS) and what they mean. Big-Oh notation for worst case complexity of algorithms. Growth rates of some common functions. Implementing our own List ADT: Version 2 (Making it generic), Version 3 (Using dynamic arrays). Comparing it to Java ArrayList.

K&W: Chapter 2



Class Example Files:
SimplifiedList2.java (Generic)
ArrayListFixed2.java (Generic)
ArrayListFlexible.java (Generic)
 

10/08

Linked Lists: Design & implementation.

K&W: Chapter 2

Submit: Assignment 4

Class Example Files:
LinkedList.java
Node.java



Exercise: Complete the implementation of LinkedList.java. Note: LinkedList.java should compile as downloaded if you also have Node.java, and SimplifiedList2.java in the same directory.


10/13

Fall Break

 


 

10/15

Fall Break

 

 

 

7

10/20

Implementing Linked Lists. Comparing List implementations. 

K&W: Chapter 3&4
 

 

Class Example Files:
LinkedListCollection.java (This extends the AbstractCollection abstract class so that we don't have to implement the value based access, such as contains(E) and remove(E).)
LinkedListIterator.java



Exercise: Complete the implementation of LinkedListCollection.java. Note: LinkedListCollection.java should compile as downloaded if you also have Node.java, and SimplifiedList2.java and LinkedListIterator.java in the same directory.

 

10/22

Stacks & Queues
Introduction to Stacks & Queues. Queues: Applications- Discrete event simulation.

Start: Assignment 5

Class Example Files:
Queue.java
Stack.java


 

8

10/27

Java Collection Framework & Stack Applications
Review of Assignment#4, Java Collection Framework. Stack applications: pre/post fix expressions. Using Iterators.  



Exam 2 Review Topics

 

10/29

Recursion. Writing recursive functions.  

K&W: Chapter 5


 

9

11/03

Exam 2


 

 

11/05

Sorting, Part 1 (Basic sorting algorithms): Bubble Sort, Selection Sort, Insertion Sort. Complexity/Comparison.


K&W: Chapter 8 (Sections 8.1-8.5 only)

Extra Credit Assignment (optional)
Merge.java <--- Note: You can use this as a starting point for problem 3.

10

11/10

Sorting, Part 1b (Basic sorting algorithms): Implementation Bubble Sort, Selection Sort, Insertion Sort. Complexity/Comparison.

K&W: Chapter 8 (Sections 8.1-8.5 only)

Submit: Assignment 5

 

11/12

Binary Trees
___________________
Hierarchical Data Structures: Trees - terminology, binary trees, expression trees, binary search trees, tree traversals: Preorder, inorder, and postorder traversals.


K&W: Chapter 6


Start: Assignment 6   

Group A Sort (insertion and selection sort)
Group B Sort (bubble sort)
Group C & D Sort (bubble sort)
Group E Sort (selection sort)

11

11/17

Implementing Binary Trees. Implementing Binary Search Trees. The Comparable interface in Java. Defining your own exceptions.

K&W: Chapter 6

 

 

11/19

Binary Search Trees, contd. Heaps & priority Queues.

K&W: Chapter 7

 

 

12

11/24

Sets and Maps in Java Collections Framework.

K&W: Chapter 7

 

11/26

Thanksgiving Break


 

13

12/01

Hash Tables: details. Hash tables internals: Open Addressing (w/ Linear Probing, Quadratic Probing), Chaining. Sorting: Selection Sort and Insertion Sort. Analysis for Sorting algorithms.

Submit: Assignment 6


 

12/03

Sorting: Quick Sort, Heap Sort, Merge Sort. How to sort using Java libraries.

 

 

Exam 3 Review Topics

14

12/08

Today is our last lecture. Review and wrap up.



 

12/10

Exam 3 

 


 

FINALS WEEK

12/13

 

 


 

 

 


Course Policies

Communication

Attendance and active participation are expected in every class. Participation includes asking questions, contributing answers, proposing ideas, and providing constructive comments.

As you will discover, I am a proponent of two-way communication and I welcome feedback during the semester about the course. I am available to answer questions, listen to concerns, and talk about any course-related topic (or otherwise!). Come to office hours! This helps me get to know you. You are welcome to stop by and chat. There are many more exciting topics to talk about that I won't have time to cover in-class.

Please stay in touch with me, particularly if you feel stuck on a topic or assignment and can't figure out how to proceed. Often a quick e-mail, phone call or face-to-face conference can reveal solutions to problems and generate renewed creative and scholarly energy. It is essential that you begin assignments early.

Grading

There will be 6-8 assignments, weighted equally in the final grading (see below).  Assignments must be submitted according to the instructions provided in each assignment.

There will be several assignments, weighted equally in the final grading (see below).  Assignments must be submitted according to the instructions provided in each assignment. Each evaluation component (assignment or exam) will receive a grade between 0.0 and 4.0. At the end of the semester, final grades will be calculated as a weighted average of all these grades according to the following weights:

Exam 1: 20%
Exam 2: 20%
Exam 3: 20%
Assignments: 40%
Total: 100%

Incomplete grades will be given only for verifiable medical illness or other such dire circumstances, if supported by your Academic Dean in a written/electronic communication.

Technology in the classroom

The class meetings/lectures will be a place to learn the concepts that are a part of the syllabus. I will, in the course of a lecture, write code on the board, and/or even do some live coding in class. The objective of this is to illustrate to you how to go about applying the concepts in practice. It is NOT a place for you to open your laptops and start to code with me. In fact, you are encouraged NOT to bring your laptops to class to use them for any purpose. It is distracting to other students. Phone (smart or otherwise) and tablet use during class meetings is also strongly discouraged. Listen, understand, ask questions, and take notes in a notebook if you need to. You will learn more!

The assignments in this course are a place for you to exercise your learning of the concepts and apply them in actual working programs. The best way to get the most of of this course is to try out and code the concepts learned in the class (outside the class!). Do not be afraid to try things! This will improve your understanding and raise questions that you should feel free to bring forward in class. A quick word of advice: stay abreast of the material covered in class, and start your assignments on the day they are announced.

Submission, Late Policy, and Making Up Past Work

All work must be turned in either in hard-copy or electronic submission, depending on the instructions given in the assignment.  E-mail submissions, when permitted, should request a "delivery receipt" to document time and date of submission.  Extensions will be given only in the case of verifiable medical excuses or other such dire circumstances, if requested in advance and supported by your Academic Dean.

No assignment will be accepted after it is past due.

No past work can be "made up" after it is due.

No regrade requests will be entertained one week after the graded work is returned in class.

Exams

There will be three exams in this course.  The exams will be closed-book and closed-notes.  The exams will cover material from lectures, homeworks, and assigned readings.

Study Groups

I encourage you to discuss the material and work together to understand it. Here are some thoughts on collaborating with other students:

If you have any questions as to what types of collaborations are allowed, please feel free to ask.

Academic Support Services

Bryn Mawr College offers a wide array of resources to help students be successful. The support services listed below can help Bryn Mawr students to:

For more information, please visit: Bryn Mawr College Academic and Student Support Services


Links

These references will be useful throughout the semester:
Last modified: Sat Dec 5 02:03:30 EST 2015