How many stacks?
T. William Wells
bill at proxftl.UUCP
Sun Aug 28 01:21:36 AEST 1988
In article <8604 at ihlpb.ATT.COM> tainter at ihlpb.UUCP (55521-Tainter,J.A.) writes:
: You haven't eliminated the stack in this case. You have just made it
: less obviously a stack. You will find that these frames still need to
: form a stack for call returns.
Yes he has. A `stack', as he was using the term, refers to a
particular way of using memory. What he has is a linked list.
Both have the characteristics you need for implementing
recursion.
There is a use of `stack' that refers to any way of doing LIFO
but that use does *not* talk about implementation. Since the
original discussion was talking about stacks in the sense of
hardware stacks or memory set aside for a stack, this use is
irrelevant.
This is an example of a generic problem on the net: seeing
similarities at some level of description and then demanding that
the similar things be called by the same name. So, since a
linked list can be accessed on a last-in, first-out basis, as can
a stack, this notion would require calling both a stack. *A
linked list is not a stack.* Of course, this problem is
aggravated here because the concept of a data structure that
implements LIFO is also called a `stack'.
There was a similar sillyness recently where the words
`iteration' and `recursion' were confused.
Let's keep our concepts straight.
Please?
---
Bill
novavax!proxftl!bill
More information about the Comp.lang.c
mailing list