Skip to main content





Lecture Notes

Readings refer to the course text: Data Structures and Abstractions with Java, 2nd edition by Frank M. Carrano, Prentice Hall, 2007. ISBN 0-13-237045-X. See also the Prentice Hall website for additional material.

LECTURE DATE TOPICS NOTES/EXAMPLES READING
1. Introduction 8/28 Course policies and procedures
2110 and 2111
A motivating application
Why this course is important
Lecture Notes
Lecture Notes (6up)
Software Article
Sam Loyd Proof
The 15 Puzzle
About Sam Loyd
Chapter 1
Appendix A
2. Java Review 9/2 Brief programming language history
Basic Java/OO concepts
Tour of the Java API
Java tips, tricks, and pitfalls
Type hierarchy and subtyping
Inheritance
Method overriding
Debugging
Lecture Notes
Lecture Notes (6up)
CommandLineArgs.java
Enum.java
Equals.java
FileIO.java
Generics.java
MultiArray.java
Widget.java
ShadowTest.java
ConstructorSuper.java
ConstructorThis.java
SuperMethod.java
Chapter 2
Appendix B
Appendix C
3 Software Design Principles I 9/4 Top-Down, Bottom-Up Design
Software Process (briefly)
Modularity
Information Hiding, Encapsulation
Principles of Least Astonishment and “DRY”
Refactoring
Lecture Notes
Lecture Notes (6up)
 
4. Interfaces and Types 9/9 Interfaces
Abstract classes
Static vs dynamic types
Up- and downcasting
Maintaining abstraction boundaries
Lecture Notes
Lecture Notes (6up)
Chapter 3
5. Software Design Principles II 9/11 Test-driven development and JUnit
Incremental development
Lecture Notes
Lecture Notes (6up)
SmallSet.java
SmallSetFullException.java
SmallSetTest.java
6. Recursion 9/16 Recursive programs
Stack frames and recursive calls
The induction principle
Lecture Notes
Lecture Notes (6up)
Power.java
HanoiRecursive.java
HanoiIterative.java
Chapter 10
7. Grammars and Parsing 9/18 Grammars
Parsing
Lecture Notes
Lecture Notes (6up)
SimpleExpression.java
SimpleExpressionCodeGenerator.java
Appendix B
8. Lists 9/23 Singly-linked lists
Building and searching
Insertion and deletion
Doubly-linked lists
Lecture Notes
Lecture Notes (6up)
List.java
ArrayList.java
LinkedListIterative.java
LinkedListRecursive.java
ListTest.java
Chapters 4-7
9. Trees 9/25 Tree implementations
Binary Search Trees (BSTs)
Tree traversals
Lecture Notes
Lecture Notes (6up)
BST.java
BSTTest.java
BSP.jar
Chapters 25-27
10. GUI Statics 9/30 Components
Containers
Layout managers
Lecture Notes
Lecture Notes (6up)
Intro.java
Basic1.java
Basic2.java
Calculator.java
ComponentExamples.java
LayoutDemo.java
Statics1.java
Statics2.java
Statics3.java
Swing Tutorial
11. GUI Dynamics 10/2 Event-driven programming
Java event model
Events
Listeners
Adapters
Lecture Notes
Lecture Notes (6up)
Example1.java
ListenerExample1.java
ListenerExample2.java
ListenerExample3.java
AdapterExample.java
Scribble.java
Swing Tutorial
12. Searching and Asymptotic Complexity 10/7 Linear vs Binary Search
Runtime analysis
Big-O
Worst-case and expected-case
Lecture Notes
Lecture Notes (6up)
Search.java
SearchTest.java
Chapter 16
Class Canceled 10/9 Class canceled due to family emergency
Fall Break 10/14 no lecture
13. Sorting 10/16 Insertion Sort
Selection Sort
Merge Sort
Quick Sort
Stable sorting
Lower bound for comparison sorts
Lecture Notes
Lecture Notes (6up)
Sorter.java
InsertionSort.java
SelectionSort.java
MergeSort.java
QuickSort.java
SortTest.java
Chapters 11, 12
14. Generic Types and Java Collections 10/21 Generic types
Java Collections Framework
Lecture Notes
Lecture Notes (6up)
Java API
15. Software Design Principles III 10/23 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
Lecture Notes
Lecture Notes (6up)
Observable.java
Observer.java
ObserverTest.java
TreeNode.java
Visitor.java
VisitorTest.java
16. Standard ADTs 10/28 Stacks
Queues
Dictionaries
Hashtables
Lecture Notes
Lecture Notes (6up)
Chapters 17-22
17. Priority Queues and Heaps 10/30 Priority Queues
Heaps
Lecture Notes
Lecture Notes (6up)
Chapters 23, 24, 28
18. Graphs I 11/4 Graphs
Topological sort
Coloring, Planarity
DFS
BFS
Dijkstra's Algorithm
Lecture Notes
Lecture Notes (6up)
Chapters 30, 31
19. Graphs II 11/6 Dijkstra's algorithm
Minimum spanning trees
Prim's algorithm
Lecture Notes
Lecture Notes (6up)
Digraph.java
Chapters 30, 31
20. Threads and Concurrency I 11/11 Java threads
The event dispatch thread
Locking and synchronization
Wait/notify
Lecture Notes
Lecture Notes (6up)
21. Induction 11/13 The Induction Principle
Induction and Recursion
Lecture Notes
Lecture Notes (6up)
22. Recurrences 11/18 Recurrences
Techniques for Solving Recurrences
Fibonacci Recurrence
Strassen's Algorithm
Lecture Notes
Lecture Notes (6up)
Fibonacci proof
Prelim Review 11/20
23. The Java Virtual Machine 11/25 Platform independence
Class file format
Bytecode examples
Class loading and initialization
Object initialization
Lecture Notes
Lecture Notes (6up)
BytecodeExamples.zip
Thanksgiving 11/27 no lecture
24. The Java Virtual Machine II 12/2 Instance Method Dispatch
Exception Handling
The Java Security Model
Bytecode Verification
Stack Inspection
Lecture Notes
Lecture Notes (6up)
Some papers on stack inspection:
Erlingsson
Fournet
Wallach
25. Review and Open Questions 12/4 Review of CS2110
Some open questions
Lecture Notes
Lecture Notes (6up)
The Open Problems Project