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 | 8/23 |
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 | 8/28 |
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 | 8/30 |
Classes and Objects Information Hiding Encapsulation |
Slides (6-up) Code Example: Minecraft (see Javadocs) [direct src link] |
|||
4 | Interfaces and Types | 9/4 |
Interfaces and abstract classes Types and casting Dynamic vs. static types Method dispatch |
Slides (6-up) | Appendix D | ||
5 | Recursion | 9/6 |
Recursive functions Problem solving as search Stack frame Stack |
Slides (6-up) Power.java |
Chapter 7 | ||
6 | Parsing | 9/11 |
Grammars Parsing |
Slides (6-up) SimpleExpression.java SimpleExpressionCodeGenerator.java |
|||
7 | Software Design | 9/13 |
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 | 9/18 |
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 | 9/20 |
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 | 9/25 |
Linear vs Binary Search Runtime analysis Big-O Worst-case and expected case |
Slides (6-up) Search.java SearchTest.java |
Chapter 4, 18 | ||
11 | Sorting | 9/27 |
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 Sorting Algorithms (Wikipedia) |
Chapters 8, 9 | ||
12 | Generic Types and Java Collections | 10/2 |
Formal type parameters Wildcards Bounded wildcards Collections framework |
Slides (6-up) |
Generic Types Tutorial Collections Intro and API |
||
13 | Graphical User Interfaces (Statics) | 10/4 |
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 | ||
14 | Graphical User Interfaces (Dynamics) | 10/11 |
Event-driven programming Events Listeners Adapters |
Slides (6-up) Example1.java ListenerExample1.java ListenerExample2.java ListenerExample3.java AdapterExample.java Scribble.java |
Swing Tutorial | ||
15 | Designing, Coding, and Documenting | 10/16 |
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, Appendix G | ||
16 | Standard ADTs | 10/18 |
Stacks Queues Dictionaries Hashtables |
Slides (6-up) | Chapters 19-22, 5-6 | ||
17 | Heaps and Priority Queues | 10/23 |
Priority Queues Heaps |
Slides (6-up) | Chapters 10, 11, 26 | ||
18 | Graphs I | 10/25 |
Graphs Topological sort Coloring Planar graphs Bipartite graphs Traveling salesman problem |
Slides (6-up) | Chapters 28, 29 | ||
19 | Graphs II | 10/30 |
DFS BFS Shortest Path |
Slides (6-up) |
Chapters 28, 29 Wikipedia on Dijkstra's Algorithm |
||
20 | Graphs III | 11/1-11/6 |
Spanning Trees Other graph algorithms |
Slides (6-up) | Wikipedia on Kruskal's Algorithm and Prim's Algorithm | ||
-- | Path Planning / HW5 | 11/8 | Dijkstra and A* Search | On chalkboard |
Wikipedia on A* Search Introduction to A* pathfinding |
||
-- | Q & A session | 11/13 | Prelim 2 tonight |
On chalkboard Prelim2 Review notes (2009 fa). |
|||
21 | Concurrency | 11/15 |
Java Threads Locking Race Conditions Deadlocks wait/notify |
Slides (6-up) | |||
22 | Induction | 11/20 |
The Induction Principle Induction and Recursion |
Slides (6-up) |
Some examples: simple & harder |
||
23 | Recurrences | 11/27 |
Recurrences Techniques for Solving Recurrences Mergesort Fibonacci Recurrence Strassen's Algorithm |
Slides | |||
24 | Wrap-up | 11/29 |
Review Further directions Open questions |
Slides (6-up) |