Stack: first in last out?
Monkey Forums/Monkey Programming/Stack: first in last out?
| ||
Does the current stack module do a first-in last-out? Surprised I don't see it. Could use a "PopLast:T()" for queues, but i suppose you'd need another variable to track location of both ends, to avoid costly list iterations. Or pre-define a FILO over FIFO. Should I just use a list? |
| ||
First-in last-out is the standard for stacks. There is a ring buffer class for first-in first-out. I don't think Monkey has a deque class as yet, but maybe one could make one from an adapted ring buffer. |
| ||
sorry! I meant FIFO! you're right, FILO is standard. i'll look a the ring buffer and see what it has. |
| ||
|