Implement a method replace for the ADT bag that replaces

Implement a method replace for the ADT bag that replaces and returns an unspecified object currently in a bag with a given object.