Click here to Skip to main content
15,905,587 members
Home / Discussions / C#
   

C#

 
Questionhelp please, set focus to control Pin
CandyMe22-Oct-05 16:14
CandyMe22-Oct-05 16:14 
AnswerRe: help please, set focus to control Pin
MoustafaS22-Oct-05 16:44
MoustafaS22-Oct-05 16:44 
GeneralRe: help please, set focus to control Pin
CandyMe23-Oct-05 15:33
CandyMe23-Oct-05 15:33 
AnswerRe: help please, set focus to control Pin
MoustafaS23-Oct-05 16:05
MoustafaS23-Oct-05 16:05 
GeneralRe: help please, set focus to control Pin
Anonymous23-Oct-05 16:09
Anonymous23-Oct-05 16:09 
QuestionImage Display Pin
MKlucher22-Oct-05 15:07
MKlucher22-Oct-05 15:07 
AnswerRe: Image Display Pin
MoustafaS22-Oct-05 15:35
MoustafaS22-Oct-05 15:35 
QuestionRelease versus Debug exception catching? Pin
theFrenchHornet22-Oct-05 14:11
theFrenchHornet22-Oct-05 14:11 
AnswerRe: Release versus Debug exception catching? Pin
Stefan Troschuetz22-Oct-05 22:12
Stefan Troschuetz22-Oct-05 22:12 
AnswerRe: Release versus Debug exception catching? Pin
mav.northwind22-Oct-05 23:32
mav.northwind22-Oct-05 23:32 
GeneralRe: Release versus Debug exception catching? Pin
Daniel Grunwald23-Oct-05 2:34
Daniel Grunwald23-Oct-05 2:34 
AnswerRe: Release versus Debug exception catching? Pin
theFrenchHornet23-Oct-05 5:56
theFrenchHornet23-Oct-05 5:56 
QuestionNetworking Problem.Please Help!!! Pin
snouto22-Oct-05 14:00
snouto22-Oct-05 14:00 
Question#using a C# dll Pin
Joel Holdsworth22-Oct-05 12:00
Joel Holdsworth22-Oct-05 12:00 
AnswerRe: #using a C# dll Pin
André Ziegler22-Oct-05 12:09
André Ziegler22-Oct-05 12:09 
AnswerRe: #using a C# dll Pin
leppie22-Oct-05 12:33
leppie22-Oct-05 12:33 
QuestionRe: #using a C# dll Pin
Joel Holdsworth22-Oct-05 12:40
Joel Holdsworth22-Oct-05 12:40 
AnswerRe: #using a C# dll Pin
leppie22-Oct-05 22:15
leppie22-Oct-05 22:15 
AnswerRe: #using a C# dll Pin
Guffa22-Oct-05 19:02
Guffa22-Oct-05 19:02 
GeneralRe: #using a C# dll Pin
Joel Holdsworth22-Oct-05 22:54
Joel Holdsworth22-Oct-05 22:54 
GeneralRe: #using a C# dll Pin
Rob Graham23-Oct-05 5:52
Rob Graham23-Oct-05 5:52 
Questioncheckedlistbox and numericupdown Pin
Mridang Agarwalla22-Oct-05 10:32
Mridang Agarwalla22-Oct-05 10:32 
Questionduplicates in array Pin
Mridang Agarwalla22-Oct-05 10:14
Mridang Agarwalla22-Oct-05 10:14 
AnswerRe: duplicates in array Pin
turbochimp22-Oct-05 10:38
turbochimp22-Oct-05 10:38 
AnswerRe: duplicates in array Pin
Matt Gerrans22-Oct-05 19:57
Matt Gerrans22-Oct-05 19:57 
Probably the fastest way is to put them both into a Hashtable as key values, then get the Keys propery from it. However with only 500 of one and 100 of the other, performace shouldn't be a big issue. It won't preserve order, of course.

Here's how it would look for strings:
string [] MergeLists( string [] A, string [] B )
{
   Hashtable table = new Hashtable();
   foreach( string s in A )
      table[s] = s;
   foreach( string s in B )
      table[s] = s;
   ArrayList items = new ArrayList( table.Keys );
   return (string[])items.ToArray( typeof(string) );
}


If you had really large collections to merge, this would probably pay off performance-wise. For smaller collections it won't hurt too much to search through for collisions (or even wrap them in ArrayLists and use Contains()).

Matt Gerrans

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.