The exercises will help
you to master the basic concepts for the given week. The links to the text and to additional resources,
such as diagrams, or Java code are given below.
Homework assignments must be submitted electronically by 8:00 pm on Monday unless otherwise specified.
Turn in each assignment with a Java comment on the top of the assignment that specifies the following pieces of information:
- Assignment: (number)
- ID: (last 4 digits only)
- Instructor: (Proulx - 9:15, Proulx - 10:30, or Barzilay)
- Head Lab TA
- Lab time: (if partners in different labs, add extra info below!!)
Omission of this information leads to immediate loss of all credit for the homework.
Review HtDP: data definitions and class diagrams to represent classes; containment.
Designing classes of data: unions, self-reference, complex class hierarchies.
Complex self-referential data; Methods for simple classes including composition and conditional; Methods for containment.
Methods for unions, self-referential and mutually referential data.
Abstracting classes: lifting fields, lifting methods, creating a super class, a union, deriving subclasses; Using libraries: The World teachpack.
Intergrity of data: constructors, privacy modifiers, exceptions; Cyclical data; ADT for a data 'container' with traversal.
Mutating structures, Testing the effects; Abstracting over data types: genericity.
Algorithms for generics; Function objects, iterators; In-situ algorithms; Stress tests.
Converting structural recursion to iteration; Algorithms that use direct access; Graph traversal: path in an acyclic graph.
Linear structures; Graph traversals: DFS, BFS, shortest path, minimum spanning tree (optimizing the performance); Overriding toString(), equality tests, JUnit.
Project: MapQuest - part 1.
Project: MapQuest - part 2.