I have a list of an object which contain info for different flights and each flight has one date. What i was trying to accomplish is get the user to pick a date then I would iterate through the list to return flights on that date but also a couple of days earlier and after.
How to do it?
Logic-----------
You could try putting the flight objects into a map where the date is the key and the value is a list of all the flights on that date.
It would mean getting flights on a specific date is n(1) and assuming your date range is a constant (x days) you'll make additional 2x n(1) lookups.
If your bounds are infinite or potentially very large that's probably not the way to go.