6.6 listing for the Bag class implemented using a linked list