Design vs. Implementation

As always, we need to separate design and implementation. Deciding whether to store our list in a file or in RAM is an implementation detail. The need to store it somewhere and read it backwards is a design detail.

Do not let thoughts about RAM and disk creep into your head while designing the solution to this problem. The design demands only that the solution remember every value entered. This is the important difference between the solutions for printing the list in forward or reverse order. To print them in forward order, the solution can read one value, print it, and forget it. To print them in reverse order, they must all be remembered until the last one is entered.

Conceptually, a one-dimensional list of data can be represented as a vector:

[ a0, a1,, ... an ]

Vectors can represent any one-dimensional collection of data, such as a simple list, coefficients of a point in space, or a polynomial (each ai represents a coefficient).

2.5x2 - 3.9x + 7.2 = [ 2.5 -3.9 7.2 ]

The variables we've worked with until now, which hold a single value, are scalar, or dimensionless.