The undefined "subset" means that you can not use

tricks like a bit tests and a lot of things, can

be implemented if you have a constant subset. OK,

the only thing possible in this case - to sort

subset and check each element of set for highest

and lowest range of subset.

If you can sort set - sort it, find a range where

elements can be a members of subset and check only

this elements.

Another way (if you have enough memory, for bytes

for example) to create array of mask that keeps 1

for each element that is a member.

//example for bytes

unsigned char member[0x100];

void make_subset(char * subset, int len)

{

int tmp;

for (tmp=0;tmp<0x100;tmp++) member[tmp]=0;

for (tmp=0;tmp<len;tmp++) member[subset[tmp]]=1;

}

int is_member(unsigned char x)

{

return member[x];

}

Look Borland C 3.1 RTL how to use it with maximum

performance.

Regards

tricks like a bit tests and a lot of things, can

be implemented if you have a constant subset. OK,

the only thing possible in this case - to sort

subset and check each element of set for highest

and lowest range of subset.

If you can sort set - sort it, find a range where

elements can be a members of subset and check only

this elements.

Another way (if you have enough memory, for bytes

for example) to create array of mask that keeps 1

for each element that is a member.

//example for bytes

unsigned char member[0x100];

void make_subset(char * subset, int len)

{

int tmp;

for (tmp=0;tmp<0x100;tmp++) member[tmp]=0;

for (tmp=0;tmp<len;tmp++) member[subset[tmp]]=1;

}

int is_member(unsigned char x)

{

return member[x];

}

Look Borland C 3.1 RTL how to use it with maximum

performance.

Regards