C# Binary Search
<pre><code>public int BinarySearch(int x)
{
    //if (Attendees.Length == 0)
    //    return -1;
    int mid =  (Count/ 2) -1;
    Student cur = new Student(x);

    while (cur.CompareTo(Attendees[mid]) != 0)
    {
        int sCount = Count;
        if (cur.CompareTo(Attendees[mid]) &lt; 0)
        {
            int NCount = sCount / 2;
            mid = NCount / 2 - 1;    
        }
        if (cur.CompareTo(Attendees[mid]) &gt; 0)
        {
            int Start = mid +1;
            mid = (Start + sCount) / 2;
        }
        else
            break;

        cur = Attendees[mid];                
    }
    if (cur.CompareTo(Attendees[x]) == 0)
        return mid;
    else 
        return -1;
}
</code></pre>

<p>Can anyone help me find out why my binary search isn't working? I'm very new to programming so any help would be much appreciated. Thank you.</p>
