Java Finding Elements in Array
<p>I have five arrays where I store incoming int numbers like:</p>

<pre><code>int array1 = {1,6,..}
int array2 = {2,7,..}
.
.
int array5 = {5,10,..}
</code></pre>

<p>Now, what I have to do, search for next numbers in another arrays.</p>

<p>Like, </p>

<pre><code>for(i = 0, i &lt; array1.size ; i++){

int element = array1[0] ;

//here array2, array3, ..., array5 can have different size
search for array2 to find element+1
search for array3 to find element+2
.
.
search for array5 to find element+5
}
</code></pre>

<p>What I am doing right now is:</p>

<pre><code>Run for loop for 0 to array2 size, to find element+1 (so for others)
</code></pre>

<p>However, it is quite slow. Can anybody give me some idea, how to make it faster (I can change array to any-other data-structure also).</p>

<p>Sorry, I make two mistakes while asking, what I should mention:</p>

<pre><code>1) Arrays are sorted (incremental elements always).
2) Array elements are very few (2-3) so Binary Search will be expensive.
3) I have to perform the search for thousand times means when channel input pause, I have to perform search, then again channel start and I have to perform search ... so on.
</code></pre>
