24 for (i= 0; i <
oldn; i++) {
39 if (l->item == x)
return &(l->item);
54 if (size == n *
max) resize (n << 1);
66 if ((*lptr)->item == x) {
71 lptr= &((*lptr)->next);
81 for (i= 0; i < n; i++)
89 int i= 0,
j= 0, n=
h1->n;
90 if (
N (
h1) >
N (
h2))
return false;
93 for (; !
is_nil (l); l= l->next,
j++)
94 if (!
h2->contains (l->item))
return false;
114 int i= 0,
j= 0, n= h->n, size= h->size;
118 for (; !
is_nil (l); l= l->next,
j++) {
120 if (
j != size - 1) out <<
", ";
int N(array< T > a)
Get the length of the array.
int hash(pointer ptr)
Computes a hash value for a pointer.
The list class represents a linked list.
list(T item)
Construct a new list object with a single item.
void tm_delete_array(C *Ptr)
static T * search(list< T > l, T x)
bool operator<(hashset< T > h1, hashset< T > h2)
Less-than comparison operator for hash sets.
bool operator<=(hashset< T > h1, hashset< T > h2)
Less-than-or-equal-to comparison operator for hash sets.
hashset< T > copy(hashset< T > h)
bool operator==(hashset< T > h1, hashset< T > h2)
Equality comparison operator for hash sets.
tm_ostream & operator<<(tm_ostream &out, hashset< T > h)
bool is_nil(list< T > l)
Check if a list is nil (i.e., an empty list).
SI max(SI i, SI j)
Returns the maximum of two signed integers.