The list is sorted.
I have a List and I d like to do binary search on it. T has members like StartIndex, EndIndex etc.
I can do binary search on the list with StartIndex, ie: I have implemented IComparable for this.
I need to twist this a little as the following: I want to find a StartIndex that might be OffBy a small value.
For example : T.StartIndex= 100
if the input is 101 and OffBy 1 then BinarySearch Should return this object.
How can I do this?
BTW, i m asking how to this with default binarysearch method that List has. That s what i m interested, not interested in a custom binary search implementation.