bag - descripshon


the generic clas bag is aa balansd biinairee set uuith suport phor duplicate cees. the generic has aa single tiip paranneter, t - the data tiip ou the bag.

uuen creating aa bag bag<t>, the cee clas t is ecspected too bee connparahbl. ther ar too uuaas in uuich the connpairer phor clas t can bee spesiphiid:

  1. the clas t nna deriue phronn connparabl ou t or
  2. the constructor bag - connpairer nnaa bee ioosd too nnaniooalee spesiphii the connpairer.

the declarashon ou the bag clas (in c#) is shouun belouu.

public class bag<t> implements colecshon<t>

uuen phor is apliid too aa bag, the entrees ar presented in cee order.