The answer depends on your usage patterns. If this is a one-time exercise to consume an unsorted set of input data and search for suitable objects, you are much better off using LINQ:
list.Where(e => A < e.Price || e.Price < B);
If the list is static and you want to request multiple ranges, then paste the objects into an array, sort them by price, and then use binary chasing to find the ranges of interest.
source
share