I have a TList that I need to perform a binary search on.
The problem is that some items in the list contain nil, (are purposely assigned nil). For the ones that are populated we have a pointer to a floating point value that we are searching for.
The list cannot be sorted prior to the search, and the nil values cannot be removed prior to searching.
We basically need to return the index of the matching item, but obviously we are unable to perform any comparisons using the items that are nil.
Can anyone offer a modified binary search function that will handle the nil items in the list?
Hope this makes sense...