That's really a question for your instructor, but the way I take it, the j in the question is just a temp variable name and has nothing to do with any 'j' values that happen to be in the stack. But I...
Type: Posts; User: KevinWorkman
That's really a question for your instructor, but the way I take it, the j in the question is just a temp variable name and has nothing to do with any 'j' values that happen to be in the stack. But I...
Sometimes the best way to figure that part out is to draw some examples. So say we have this as a stack:
{1, 2, 3, 4, 5}
...and n = 3. What should happen?
Well, first off, what is the 3rd...
Seems reasonable to me, but really, the best way to test is to simply let the code do the talking. It doesn't matter what we think, just what the program does. Try stepping through it with a debugger...
What happened when you tried exactly that?
Is this a different question than the one you posted here: Can somebody help me with stacks?
Anyway, the best way to test this is to throw together a little example program that does exactly what...