Implementation of Stack and Queue