CS 35 Algorithms and Object-Oriented Programming
TR 9:55-11:10am, SCI 240
Fall 2005
Swarthmore College

Professor: Benjamin Kuperman
email: kuperman AT cs swarthmore edu
Please include "CS35" in the subject.
AIM: ProfKuperman
Office: SCI 253
Phone: 328-8665
Office Hours: Mon 2-3pm, Wed 9:30-11:00am

Contents


Course Description

From the department course description: This course completes the broad introduction to computer science begun in CPSC-021 and CPSC-022. It provides a general background for further study in the field. Topics to be covered include object-oriented programming in Java, advanced data structures (priority queues, trees, hash tables, graphs, etc.) and algorithms, software design and verification. Students will be expected to complete a number of programming projects illustrating the concepts presented.


Text and Useful Links

The text for the course is Data Structures and Problem Solving Using Java, Third Edition by Mark Weiss. All of the code from the text is available on the author's website: http://www.cs.fiu.edu/~weiss/dsj3/code/code.html

Useful Links


Java Documentation

java.util.* 1.5.0 Local Copy
java.util.Scanner 1.5.0 Local Copy
java.util.List<E> 1.5.0 Local Copy
java.util.ArrayList<E> 1.5.0 Local Copy
java.util.LinkedList<E> 1.5.0 Local Copy
java.util.Iterator<E> 1.5.0 Local Copy
java.util.ListIterator<E> 1.5.0 Local Copy
java.util.PriorityQueue<E> 1.5.0 Local Copy
java.util.Comparator<E> 1.5.0 Local Copy
java.util.Hashtable<K,V> 1.5.0 Local Copy
java.util.Collection<E> 1.5.0 Local Copy
java.lang.* 1.5.0 Local Copy
java.lang.Character 1.5.0 Local Copy
java.lang.Integer 1.5.0 Local Copy
java.lang.Math 1.5.0 Local Copy
java.lang.String 1.5.0 Local Copy
java.io.* 1.5.0 Local Copy
java.io.File 1.5.0 Local Copy
java.io.FileInputStream 1.5.0 Local Copy
java.io.Serializable 1.5.0 Local Copy
java.awt.* 1.5.0 Local Copy
java.awt.Color 1.5.0 Local Copy
java.awt.FlowLayout 1.5.0 Local Copy
java.awt.BorderLayout 1.5.0 Local Copy
java.awt.GridLayout 1.5.0 Local Copy
java.awt.GridBagLayout 1.5.0 Local Copy
javax.swing.* 1.5.0 Local Copy
javax.swing.JFrame 1.5.0 Local Copy
javax.swing.JPanel 1.5.0 Local Copy
javax.swing.JLabel 1.5.0 Local Copy
javax.swing.JButton 1.5.0 Local Copy
javax.swing.JComboBox 1.5.0 Local Copy
Thanks to Richard Wicentowski for this table format.

Grading

Grades will be calculated based on the following distribution:

Programming projects will generally consist of two major components:

  1. An underlying data structure implementation
  2. An application of this data structure
The actual breakdown of points will depend on the individual project, but the plurality of points will be for the data structure implementation. Projects will also be graded on style, documentation, and test cases.

If a portion of your program is not working correctly, please clearly indicate it in the comments at the beginning of the file and in the methods that are not working. Problems that I discover are graded more severely than those you discover.


Homework and Course Policy

Attendance

Regular class attendance is expected. I am required to report to the dean any student whose repeated absences is impairing their performance in the class.

Please talk to me if regular class attendance is going to be a problem.

Programming Assignments

There will be a number of assignments made in this class. I expect every student to attempt each assignment and turn in the results. Do not expect to pass this class if you do not submit something for every assignment. You are encouraged to complete every assignment as this is one of the most effective ways to learn the material.

When homework is assigned, a due date will be made available (usually Tuesday at 11:30pm). You are responsible for submitting your answers before the deadline.

If you know that for some reason you will not be able to submit the assignment before the deadline, you should contact me in advance of the deadline. Extensions are only granted in exceptional circumstances, but need to be done in advance.

Note on late projects: Normally, I do no accept late projects. This semester I am going to deviate from my policy and allow students to submit assignments late with the following penalty scale:

Because I want every student to complete these assignments, correct and working submissions after 48 hours may be accepted and used to give some minimal score for the project.

Extra credit will not be accepted after the initial deadline.

Grading

Programming assignments will be graded on both correctness as well as programming style. Good programming style includes the following:

More information on Java style can be found on Sun's Code Conventions web page. There is also an open source tool checkstyle that can be used to check the style used.

Plagiarism and Academic Dishonesty

The College's Judiciary Committee (CJC) handles plagiarism offenses. The penalties for plagiarism are quite severe: usually the first offense leads to failure in the course, but it may additionally result in suspension. The following constitutes plagiarism on CS programming assignments:

Under no circumstances may you hand in work done with (or by) someone else under your own name. Your code should never be shared with anyone; you may not examine or use code belonging to someone else, nor may you let anyone else look at or make a copy of your code. This includes sharing solutions after the due date of the assignment. Failure to abide by these rules constitutes academic dishonesty and will lead to a hearing of the College Judiciary Committee.

Discussing ideas and approaches to problems with others on a general level is fine (in fact, we encourage you to discuss general strategies with each other), but you should never read anyone else's code or let anyone else read your code. If you are in doubt about some help that you received, then credit the person(s) from whom you got help by citing them in a comment at the top of the file and discuss the situation with your instructor.


Clinic

The CS35 clinician is an additional resource to help you with this class. The clinician is available for 3 hours per week and will help you with any problems you are having in the class. If you use the clinician to help you with your homework, please cite their help.

Bronwyn Woods

Clinician: Bronwyn Woods
Location: SCI 240
Hours: Tuesday, 6-9pm

Dan Amato

Clinician: Dan Amato
Location: SCI 240
Hours: Sunday, 1-4pm


Schedule

(Subject to change)
WEEK DAY Note READING HW
1 Aug 30 Using Unix #1 4pm-5pm
Using Unix #1 8pm-9pm (Aug 31)
Introduction to Java
(Read Ch 1,2)
HW0 - HelloWorld
Sep 01 InClass: TestException.java, PrintInt.java
2 Sep 06 Using Unix #2 4pm-5pm
Using Unix #2 8pm-9pm (Sep 07)
HW1 - TicketCounter
Sep 08 Last Day to Add/Drop (Sep 09) Object Oriented Programming in Java
  • Objects
  • Classes
  • Inheritance
  • Collections API
  • Java 1.5 Features

(Read Ch 3,4,6)
3 Sep 13 InClass: Base/Derived.java and GenericData.java HW2 - OldMatey (MyArrayList)
Sep 15  
4 Sep 20   Algorithm Analysis
  • Big-Oh Notation
  • Algorithm Growth
  • Classes of algorithms

(Read Ch 5)
HW3 - N-Queens
Sep 22   Recursion
  • PMI
  • Divide and Conquer
Data Structure: Stacks
Data Structure: Queues
(Read Ch 7.1-7.3, 7.7, 16)
5 Sep 27   HW4 - MazeSolver
Sep 29   Sorting Algorithms
  • Selection
  • Bubble
  • Insertion
  • Shell
  • Merge
  • Quick

(Read Ch 8)
6 Oct 04   HW5 - MySorts
Oct 06  
  Oct 11 October Break (Oct 8 - 17)
Oct 13
7 Oct 18   Data Structure: Linked Lists
(Read Ch 17)
HW6 - MyLinkedList
Oct 20 Midterm Exam (Evening) 7-9pm SCI 181 Topics
8 Oct 25   Data Structure: Trees
  • General
  • BST
  • AVL
  • Red-Black

(Read Ch 18,19)
HW7 - WordFrequencyTree
Oct 27  
9 Nov 01  
Nov 03 Last Day to Withdraw with W (Nov 04) Data Structure: Priority Queues
  • Heaps
  • Array based heaps
  • Heapsort

(Read Ch 21)
HW8 - ProcessQueries
10 Nov 08  
Nov 10 InClass: Swing and WebBrowswer examples Swing and Graphical User Interfaces
(Read Appendix B)
GUI work
11 Nov 15   HW9 - GUI and MyHashtable
Nov 17   Data Structure: Hashtables
(Read Ch 20)
12 Nov 22  
Nov 24 Thanksgiving Break (Nov 24 - 28)
13 Nov 29   Data Structure: Graphs
  • Representation
  • Shortest Path
  • Topological Sorting

(Read Ch 14)
HW10 - BaconNumber
  1. actors.small.txt
  2. top250.txt
  3. all.movies.txt
  4. all.txt
Dec 01  
14 Dec 06 Final topics are here
Final Exam Period: Dec 10 - 18 (Dec 09)
Finish up:
  • Review for final exam
  • Course evaluations
  • Snacks provided
  • Are students reading this?
  Dec 13 Final Exam 9am-noon

Assignments

In order to obtain and submit assignments for this class, we'll be using two tools:

First, you will need to run

update35
which will create a directory cs35 in your home directory.

Once an assignment is made, you can run update35 again and this will copy all needed files to ~/cs35/homework/X/ where you can then work on them. In class assignments will be distributed in a similar fashion.

To submit your work, run

handin35
and follow the menus. Be sure to (v)erify your submission.


Last Modified: Tue 29 Nov 2005 11:51:09 AM EST - Benjamin A. KupermanVI Powered