Fastest way to check a List<T> for a date

Posted by fishhead on Stack Overflow See other posts from Stack Overflow or by fishhead
Published on 2010-04-10T13:40:51Z Indexed on 2010/04/10 13:53 UTC
Read the original article Hit count: 246

Filed under:
|
|
|

I have a list of dates that a machine has worked on, but it doesn't include a date that machine was down. I need to create a list of days worked and not worked. I am not sure of the best way to do this. I have started by incrementing through all the days of a range and checking to see if the date is in the list by iterating through the entire list each time. I am looking for a more efficient means of finding the dates.

class machineday
{
 datetime WorkingDay;
}

class machinedaycollection : List<machineday>
{

}

© Stack Overflow or respective owner

Related posts about c#

Related posts about .net-2.0