Linear Search with Jagged Array?
<p>I have the following program that creates 100 random elements trough a array.
Those 100 random value's are unique, and every value only gets displayed once.</p>

<p>Although with the linear search it keeps looking up the entire array.
How would i be able to get a <strong>Jagged Array</strong> into this, so it only "scans" the remaining places left? (assuming i keep the table at 100 max elements, so if one random value is generated the array holds 99 elements with linear search scans and on...)</p>

<p>I assume i would have to implent the jagged array somewhere in the FoundLinearInArray?</p>

<p>Hopefully this made any sence.
Regards.</p>

<pre><code> private int ValidNumber(int[] T, int X, int Range)
    {
        Random RndInt = new Random();
        do
        {
            X = RndInt.Next(1, Range + 1);
        } while (FoundLinearInArray(T, X));

        return X; 

    }/*ValidNumber*/

    private bool FoundLinearInArray(int[] A, int X)
    {
        byte I = 0;
        while ((I &lt; A.Length) &amp;&amp; (A[I] != X))
        {
            I++;
        }
        return (I &lt; A.Length);
    }/*FoundInArray*/


    public void FillArray(int[] T, int Range)
    {
        for (byte I = 0; I &lt; T.Length; I++)
        {
            T[I] = ValidNumber(T, I, Range);
        }

    }/*FillArray*/
</code></pre>
