Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

Required fields*

4
  • By definition, a stack is a LIFO collection: Last in, first out. A queue is a FIFO collection. Commented Jun 7, 2013 at 16:02
  • So is a stack the only acceptable data structure? If so, why? Commented Jun 8, 2013 at 13:07
  • @JohnR.Strohm: Fixed :-) Commented Jun 9, 2013 at 0:57
  • 2
    For languages without recursion (direct or mutal), it's possible to statically-allocate for each method a variable which will identify the place from which that method was last called. If the linker is aware of such things, it can allocate such variables in a fashion which will be no worse than what a stack would do if every statically-possible execution path were actually taken. Commented Jun 26, 2014 at 1:24