Here is a fragment of Liskov's
Poly.java
example:
// Overview: Polys are immutable polynomials c0 + c1x + c2x^2 + ...
int[] trms; int deg; // the representation
-
What is the abstraction function for this implementation?
-
What is the rep-invariant appropriate for this implementation?
Repeat for the
MapPoly.java
implementation:
// Overview: Polys are immutable polynomials c0 + c1x + c2x^2 + ...
TreeMap<Integer, Integer> trms;