Lecture Notes

Readings refer to the course text: Data Structures and Abstractions with Java, 3rd edition by Frank M. Carrano, Prentice Hall, 2011. ISBN 978-0-13-610091-1. See also the Prentice Hall website for additional material.  Readings are intended to be complementary to the lecture: you can do the reading before class, or after class, but should certainly read the chapter at some point to make sure you fully understand the material.  Exams tend to focus on things we covered in class.

LECTURE DATE TOPICS NOTES/EXAMPLES READING
1 Introduction 1/24 Course policies and procedures.
A motivating application.
Why this course is important!
Slides (6-up)
Article on Software
15-Puzzle Info
15-Puzzle Proof
15-Puzzle Code
Appendix A, B
2 Java Review 1/26 A brief history of PL concepts.
Overview of OOP concepts (objects, instances, inheritance, overloading, overriding, static vs. dynamic binding).
Common Java pitfalls.
Debugging.
Slides (6-up)
CommandLineArgs.java
Enum.java
Equals.java
FileIO.java
Generics.java
MultiArray.java
Widget.java
ShadowTest.java
ConstructorSuper.java
ConstructorThis.java
SuperMethod.java Overload.java Override.java
Appendix C, E, F
3 Modularity 1/31 Classes and Objects
Information Hiding
Encapsulation
Slides (6-up)
4 Interfaces and Types 2/2 Interfaces and abstract classes
Types and casting
Dynamic vs. static types
Method dispatch
Slides (6-up) Appendix D
5 Recursion 2/7 Recursive functions
Problem solving as search
Stack frame
Stack
Slides (6-up)
Power.java
Chapter 7
6 Parsing 2/9 Grammars
Parsing
Slides (6-up)
SimpleExpression.java
SimpleExpressionCodeGenerator.java
7 Software Design 2/14 Top-down vs. bottom-up design
Test-driven Design
Refactoring
JUnit
Debugging
Slides (6-up)
SmallSet.java
SmallSetTest.java
SmallSetFullException.java
Chapters 1-3
8 Lists 2/21 Singly-linked lists
Building and searching
Insertion and deletion
Doubly-linked lists
Slides (6-up)
List.java
LinkedListRecursive.java
LinkedListIterative.java
ArrayList.java
ListTest.java
Chapters 12-14
9 Trees 2/23 General and binary trees
Binary search trees
Tree traversals
Applications of trees
Slides (6-up)
BST.java
BSTTest.java
BSP.jar
Chapters 23-25
10 Asymptotic Complexity 2/28 Linear vs Binary Search
Runtime analysis
Big-O
Worst-case and expected case
Slides (6-up)
Search.java
SearchTest.java
Chapter 18
11 Sorting 3/1 Insertion Sort
Selection Sort
Merge Sort
Quick Sort
Stable sorting
Lower bound for comparison sorts
Slides (6-up)
InsertionSort.java
SelectionSort.java
MergeSort.java
QuickSort.java
QuickSortWithTies.java
Sorter.java
SortTest.java
Chapters 8, 9
12 Generic Types and Java Collections 3/6 Formal type parameters
Wildcards
Bounded wildcards
Collections framework
Slides (6-up) Generic Types Tutorial
Collections Intro and API
13 Designing, Coding, and Documenting 3/8 Contracts (pre- and postconditions)
Pair programming
Duplication of state
Sanity checks and the Java assert statement
The design/code/debug cycle
Javadoc
Error handling
Design Patterns
Slides (6-up)
Observable.java
Observer.java
ObserverTest.java
TreeNode.java
Visitor.java
VisitorTest.java
Chapter 15
14 Graphical User Interfaces (Statics) 3/13 Components
Containers
Layout managers
Slides (6-up)
Intro.java
Basic1.java
Basic2.java
Calculator.java
ComponentExamples.java
LayoutDemo.java
Statics1.java
Statics2.java
Statics3.java
Swing Tutorial
15 Graphical User Interfaces (Dynamics) 3/15 Event-driven programming
Events
Listeners
Adapters
Slides (6-up)
Example1.java
ListenerExample1.java
ListenerExample2.java
ListenerExample3.java
AdapterExample.java
Scribble.java
Swing Tutorial
16 Standard ADTs 3/27 Stacks
Queues
Dictionaries
Hashtables
Slides (6-up) Chapters 19-22, 5-6
17 Heaps and Priority Queues 3/29 Priority Queues
Heaps
Slides (6-up) Chapters 10, 11, 26
18 Graphs I 4/3 Graphs
Topological sort
Coloring
Planar graphs
Bipartite graphs
Travelling salesman problem
Slides (6-up) Chapters 28, 29
19 Graphs II 4/5 DFS
BFS
Shortest Path
Slides (6-up)
More Slides (6-up)
20 Graphs III 4/12 Spanning Trees
Other graph algorithms
Slides (6-up) Wikipedia on Kruskal's Algorithm and Prim's Algorithm
21 Concurrency 4/17 Java Threads
Locking
Race Conditions
Deadlocks
wait/notify
Slides (6-up)
22 Induction 4/26 The Induction Principle
Induction and Recursion
Slides (6-up)
23 Recurrences 5/1 Recurrences
Techniques for Solving Recurrences
Mergesort
Fibonacci Recurrence
Strassen's Algorithm
Slides (6-up)
24 Wrap-up 5/3 Review
Further directions
Open questions
Slides (6-up)