Compare Two ArrayList

  • Thread starter Thread starter Gomathi
  • Start date Start date
G

Gomathi

hi all,

In my windows application(C#) , i have two arraylists.
I want to compare those two arraylist.
Is there any way for that?

Thanks in advance.

Gomathi
 
Gomathi said:
In my windows application(C#) , i have two arraylists.
I want to compare those two arraylist.
Is there any way for that?

There's no automatic function that does this for you, as far as I know.
To do this properly yourself, you'll need a three (or is it only two?)
step process:

1. Compare the sizes
2. and 3. Iterate over the lists and compare the objects in them one by one, thereby effectively comparing the order of the lists and the exact content.


Oliver Sturm
 
hi,

Thanks for your reply.
I feel that this process is an expensive one.Sothat only i asked for any
other solution.
Once again thanks for that.

Gomathi
 
Gomathi said:
Thanks for your reply.
I feel that this process is an expensive one.

Do you have any evidence for that feeling though? It's absolutely
crucial for performance work that you find out just how much something
is costing before you try to improve it. Otherwise, you don't know
whether you've made an improvement or even whether you *need* to
improve it.
 
Back
Top