Mapping two set of values in C++
<p>My sincere apologies for such a naive question. I know this is simple. But nothing comes to my mind now. </p>

<p>I am using C++. I'm a bit concerned about efficiency since this is targeted for an embedded hardware with very less processing power and RAM.</p>

<p>I have 2 integer arrays with 50 members local to a function. I need to determine what is the corresponding number in the second array when an element in the first array is specified and vice versa. I have the information that the element provided to me for look-up belongs to which array i.e. array 1 or array 2.</p>

<p>Ex : <code>Array1 =&gt; 500 200 1000 300 .....</code></p>

<pre><code> Array2 =&gt; 250 170 500  400 .....
</code></pre>

<p><code>Input 500 , Output will be 250</code></p>

<p><code>Input 400 , Output will be 300</code></p>

<p><code>input 200 , Output will be 170 and so on</code></p>

<p>I think an array look-up will be least efficient. Is stl::map the best option or do i have to look for any efficient search algorithms? I would like to know if you have to do this, which option you will be choosing.</p>

<p>Any thoughts?</p>
