Pushing solutions to questions regaring stacks and queues. Description of the solutions are inline