Need help on stack method
807580May 12 2010 — edited May 14 2010Hi
I need to write a stack method which has an int index argument depending on which the specific element from the stack will be popped , but the catch is i can't use any other stack method other than push/pop/peek/empty, neither can I make any other object (not even any collection obj or string or array or any kind) or write any new method. Also , at the end of the method the original stack passed as the method argument should be kept unchanged (even if any exception happens).
Any pointer on this would be appreciated.
Indro
Edited by: ainindra on May 11, 2010 10:04 PM