Hi,
I have came with solution to remove duplicates from generic list<T> in .NET 2.0 as follows:
List<CaseStudy> caseStudies = CaseStudyDAO.FindCaseStudiesByDate(DateTime.Now.Date, DateTime.Now.Date.AddDays(1));
caseStudies.RemoveAll(
delegate(CaseStudy c)
{
return caseStudies.IndexOf(c) != caseStudies.FindIndex(
delegate(CaseStudy f) { return c.Str == f.Str; });
});
My questions are:
Is there more efficient way to do this? Only .NET 2.0 solution
What is the complexity of the above solution?
Thanks,
jan2k10