I'm new to trying to use the IEnumerable interfaces. I've always just written custom hash sorting rather than trying to use native syntax because I was somewhat confused by the implementation. I'm trying to determine if I can assemble a List in sorted format by using BinarySearch or some similar function. Is there a function that will return the nearest possible index for insertion of a new item to a List so the list always remains sorted via a hash tree every time you insert an item?
When I use BinarySearch it seems to always return -1 if there's no match. I would rather it return the nearest possible index. Is there a way to do this with the native IEnumerable interfaces? I'd rather not call "Sort(IComparer)" every time I want to reference the List.
In short: Can BinarySearch or some equivalent function be used when adding a new item to a List to find the best index to "Insert(Item, index)" into the list?