I am trying to search a descending sorted array using this binary search code. However, after I sort it, and try to search, it doesn\'t come back with any result, just a loading
Shot in the dark:
if (target < mynumbers[mid]) first = mid + 1; else if (target > mynumbers[mid]) last = mid - 1; else { .... break; }
I suspect you're bouncing back and forth between mid+1 and mid-1