I have a list of int IDs of individuals associated with a subject, with the list coming from various sources. There are most likely duplicates, but I want unique values only.
I considered what type of algorithm I would use. An array perhaps, sort it and compare. Quick sort? Double-linked list? Binary tree? (I'm being ridiculous now. Sorry.) But then it hit me that all of the user IDs, regardless of their origination, were found in a users SQL table, so after obtaining a team_ids string which looked something like '3,44,313,313,12', I turned to SQL to be my brains:
sql = "select distinct id from users where id in (" + team_ids + ") order by id";
SqlDataReader dr = SQLHelper.ExecuteReader(sql);
while (dr.Read())...
KISS, baby.