Finding sorted array index of closest int value : <p>I want to use a Lookup-table that contains 205887 positive int values. They are sorted from highest to lowest value.
I have a positive int value (int a). If I have that value inside the table, I want to receive the index (int b) of the value.
If that value does not exist inside the table, I want the index of the nearest-lower value.</p>

<p>This process is performance critical so I want it to be as fast as possible.</p>

<p>Is it possible to create an array with 2^31 values but only 205887 being initialized?
If yes, would that result in the table being roughly the same size of the one I described above?
If yes, could I find b by checking the index of this array with value a and add one to it until I find an initialized entry which contains my value b?</p>

<p>I am just a beginner at C# and could not find sufficient information in documents. Thanks in advance.</p>
