Inheritance and composition implementations of doubling stack