Click here to Skip to main content
15,887,371 members
Home / Discussions / C#
   

C#

 
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
GeneralRe: duplicates in array Pin
Matt Gerrans22-Oct-05 20:24
Matt Gerrans22-Oct-05 20:24 
QuestionHelp TreeView Pin
picasso222-Oct-05 9:31
picasso222-Oct-05 9:31 
AnswerRe: Help TreeView Pin
picasso222-Oct-05 10:29
picasso222-Oct-05 10:29 
Questionsyntax help Pin
tekken2222-Oct-05 9:21
tekken2222-Oct-05 9:21 
AnswerRe: syntax help Pin
Daniel Grunwald22-Oct-05 9:42
Daniel Grunwald22-Oct-05 9:42 
AnswerRe: syntax help Pin
User 167325222-Oct-05 21:47
User 167325222-Oct-05 21:47 
QuestionReset Panel Pin
picasso222-Oct-05 8:07
picasso222-Oct-05 8:07 
AnswerRe: Reset Panel Pin
Stefan Troschuetz22-Oct-05 8:30
Stefan Troschuetz22-Oct-05 8:30 
Questionwin32 API or DirectSound Pin
pakFari22-Oct-05 7:58
pakFari22-Oct-05 7:58 
AnswerRe: win32 API or DirectSound Pin
André Ziegler22-Oct-05 9:00
André Ziegler22-Oct-05 9:00 
GeneralRe: win32 API or DirectSound Pin
pakFari22-Oct-05 18:29
pakFari22-Oct-05 18:29 
GeneralRe: win32 API or DirectSound Pin
André Ziegler23-Oct-05 5:07
André Ziegler23-Oct-05 5:07 
GeneralRe: win32 API or DirectSound Pin
pakFari23-Oct-05 7:58
pakFari23-Oct-05 7:58 
GeneralRe: win32 API or DirectSound Pin
André Ziegler23-Oct-05 11:16
André Ziegler23-Oct-05 11:16 
GeneralRe: win32 API or DirectSound Pin
pakFari23-Oct-05 16:56
pakFari23-Oct-05 16:56 
GeneralRe: win32 API or DirectSound Pin
André Ziegler24-Oct-05 12:26
André Ziegler24-Oct-05 12:26 
QuestionUsing C++ class in C# project Pin
patgo22-Oct-05 7:42
patgo22-Oct-05 7:42 

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.