Efficient algorithm to check for subset against a range of sets
<p>I read through some of the posts about determining whether a set <code>A</code> is a subset of another set <code>B</code>. But I find it hard to determine what algorithm to use. Here is an outline of the problem:</p>

<ul>
<li>I have an array of strings <code>A</code> which I receive at the beginning of my program. Not much is known about the structure. Each string in the array can be arbitrarily long and the number of entries is not limited. Though usually it can be assumed that the number of entries in the array won't be overly large (&lt; 100).</li>
<li>Then I iterate through a list of objects of length <code>n</code>.</li>
<li>Each of the <code>n</code> objects will also have an array of strings <code>B</code>, i.e. there will be <code>n</code> <code>B</code> arrays. Once the program runs the <code>B</code>s will be fixed, i.e. they do not change during runtime.</li>
<li>I want to determine for each object if <code>A</code> is a subset of <code>B</code>.</li>
</ul>

<p>Now, I thought about hashtables. However, they would, in my opinion only be efficient if the was only one <code>B</code> and a lot of <code>A</code>s. Then I could make a hashtable for <code>B</code> and check each string array of each object against my hashtable. But this is not the case because there is only one <code>A</code> but <code>n</code> <code>B</code>s. What would be an efficient algorithm to do this?</p>

<p>Example:</p>

<pre><code>A:  ["A", "G", "T"]
B1: ["C", "G"]
B2: ["K", "A", "U", "T", "G"]
.
.
.
Bn: ["T", "I", "G", "O", "L"]
</code></pre>

<p>Here <code>A</code> is a subset of <code>B2</code> but not of <code>B1</code>, and not of <code>Bn</code>.</p>