@Override
  public boolean equals(Object obj)
  { if(obj instanceof MSet)
    { MSet that=(MSet)obj;
      if(this.size()!=that.size())
      { return false;
      }
      else
      { for(MSet<T> p=that;p!=null;p=p.next)
        { if(!this.hasElement(p.a)||(this.getFrequency(p.a)!=that.getFrequency(p.a)))
          { return false;
          }
        } 
        return true;
      }    
    }
    else
    { return false;
    }  
  }