Implement push, pop, top and isEmpty for stack