I hope the answer is recursion. The answer should
ALWAYS be recursion,
right Professor McCarthy? :)
I can't tell you how many students think recursion is the answer to
every question. (Then again, I do deal with a lot of students.) Or
that using xor is a good way to swap integers.
If I ask "How would you write a program to calculate the natural log
of 147 factorial?" and the answer doesn't involve looking up an
algorithm for the gamma function (or someone who actually remembers
the functional form of the Stirling approximation) I shout "next!"
Factorials should never be used as an example of recursion in intro
programming courses.
I think the correct answer to Chris's question is to ask whether the
reverse access is a one time thing, or if it's a significant enough
change to the software spec that the list should be doubly linked. ;)