[rui] update BinarySearch.cs; extract methods for getting half array