Given a stack that displays characters to the screen First in First Out(FIFO), how do you switch it to display them Last in First Out(LIFO). Theoretically speaking... is it simply just sending the characters to print in reverse order?
views:
133answers:
1
+1
A:
Keep length of stack, then walk along it from head to tail. You will have queue effect. But it will work only if your stack is a whole array (not linked list)
Andrey
2010-03-29 16:01:19