So I was wondering if I were to empty the elements of a stack into a queue, but i only wanted to empty the even numbers or the odd ones. What would the if statement
be to accomplish this. Im guessing for even it would be something like if(number % 2!=0)? What about for odd?
You may need another stack to temporarily store the even/odd numbers while emptying the odd/even ones. And then copy the data back.
Remember using push() and pop() operations.