CS241: Topics for the Week of September 24, 2007
[previous][next]
- Alert! Exam next week.
- When: Wednesday, Oct 3. A review will be held in class on Monday, Oct 1.
- Will cover chapters 1-5. See past exams and list of topics.
- Questions may come from
- Exercises in text
- Issues and topics discussed in class.
- Vocabulary
- Questions based on programs done in lab.
- You may need to write short snippets of code.
- Labs
- Read Chapter 4 and Chp 5
- Stacks (Partly a review from last week)
- LIFO policy - Last in, first out.
- The stack abstract data type (p. 88)
- java.util.Stack - see p. 177 Java Collections Framework. Also look in Java documentation
for full description.
- Applications:
- Towers of Hanoi
- Postfix Calculator (see lab, and problem 4.20 in text)
- Call stacks
- Many card games: solitaire, idiot's delight
- Generics
- Exceptions
- Queues
- FIFO policy - First in, first out.
- The queue abstract data type
- The Java Queue interface: java.util.Queue
- Two access points - front (remove/dequeue) and rear (insert/enqueue)
- Trickier to implement than a stack.
- Applications
- operating systems: priority (job) queues, print server
- Many card games: War, solitaire
- breadth-first-search
- Array Based Implementation of
- A deck of cards.
- The stack abstract data type.
- The queue abstract data type.
- Lists
- abstract data type: (add, contains, get, isEmpty, remove, set, size)
- Array Based Implementation: ArrayList
- Implementation in text
- java.util.ArrayList
- Problems with remove.
- Interators
- Iterable interface
- Iterator object
- See picture.
- Useful link for
Java code examples.
[top] [Schedule]
[Home]