Thanks very much for your help :)
Type: Posts; User: sim18
Thanks very much for your help :)
{1, 2, 3, 4, 5}
n = 3
nth element = 3rd element in stack, which is 3.
So you would pop() three times leaving {4,5}.
If it was j it would be exactly the same then? i.e
Thanks very much for the replies :)
I have added print statements and I can see exactly what is going on!
If I was going to take this one step further, (given integer 'n') and set j to the nth...
It created two stacks s & s2.
I then added s.push("n"); and s.push("m"); giving n & m in the stack1.... is this about right so far?
thanks
Yes this is a different question. How would I go about making a program that does what I want?
Creating my stacks (s) and (s2) - Stack s = new Stack();
...
Hi everone, I have been doing java for around a year now :)
I'm not looking for somebody to give me an answer but for guidance and help.
This is the question:
I have a stack called 's'....