Implemented each for the stack
Implemented each method for queue