Do you have a problem with the advice given the last time you asked this same question? There's only one way to learn how to code, and that's to write code. Give it a try. If you still have problems, post your code and we can give you a hand.
what should i do in the case of for example: if each stack has 5 cells and i pushed only 3 in the 1st one and i want to make the dequeue opearation
you said that that we pop from the second one but it still empty
i only push objects into the second one if the first one is full
posted 10 years ago
i thought of a method to build it
we push all of the members into stack one and if we want to make a deqeue operation we pop all of our members from the first stack and push them into the second one and then we pop our desired member and then we pop from the second stack and push into the first one
my only problem remains what should i do in case if the 1st stack gets full and we still want to push
but i geard that the stacks in java are infinite is it true??