CMPS 144 Spring 2026
Test #2 preview
The kinds of problems that you should be prepared to answer
on the test include the following:
- Given a relatively simple computational problem similar to one
that you would have solved in developing a solution to any among
Programming Assignments 1 through 3, develop code to solve it.
- Given a scenario within the context of the discrete event simulation
problem of Prog. Assg. #3, be able to explain what the next steps
of the simulation would be.
- Given some relatively simple computational problem (e.g., possibly
involving an array) and a loop invariant to guide you, develop code
to solve the problem in a manner consistent with the given loop
invariant.
(Recall the lectures pertaining to 2-color and 3-color partitioning,
as well as Labs #4 and #5, in which you implemented loops that conformed
to specified loop invariants.)
- Show the history of the pair of stacks used in evaluating an
FPAE (or some variation of an FPAE). (Recall Lab #7.)
- Show the history of the queue used in the algorithm that performs
a breadth-first search to solve the Single-source Uniform-cost
Shortest Paths problem. (Recall Lab #8.)
- Be able to interpret a diagram depicting a "wraparound" array-based
representation of a queue, and be able to show how that
representation changes as insertions and removals of elements occur.
Similarly for a Link1-based representation.
- Given a code segment that involves Link1 objects,
be able to manually trace its execution and report its results.
(Recall Lab #8.)
(Tracing execution means showing the values of relevant
variables at specified points during execution, as might
be produced by print statements.)
- Given a relatively simple computational problem involving
Link1 objects, develop code that solves it.
(Recall Lab #8.)
- Given a relatively simple computational problem pertaining
to lists-with-cursors, develop code that solves it.
(Recall Lab #9.)
- Develop a class that implements the java.util.Comparator
interface, or a similar lind of interface. (Recall Lab #9.)
- Develop code that makes use of a class that implements
an interface such as java.util.Comparator
or a similar interface. (Recall Lab #9.)