[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

microsoft.public.dotnet.framework.sdk

Re: ArrayList and Hashtable, which is better?

WildHeart'2k <stf

6/21/2004 1:56:00 PM

"Laser Lu" <Laser Lu@discussions.microsoft.com> wrote in message
news:638A4ED2-F1AD-4D6A-9D8F-300F0D5FF908@microsoft.com...
> Hi, all, I wonder that, between ArrayList and Hashtable, which one will
take the better execution efficiency?

It depends. Item insert efficiency? Item lookup efficiency? Item lookup by
index? Iten lookup by key? Item delete efficiency? Serialization efficiency?
--
WildHeart'2k4


1 Answer

Greg Young

6/21/2004 10:02:00 PM

0

This is an identical question to "What is better a linked list or a hash
table". I can tell you point blank that for searching the hashtable will
generally outperform the arraylist (especially with large sets) but the
arraylist can be more efficient at sorting (i.e. sortedlist). In order to
state anything further one would need to know the problem domain.


"Laser Lu" <Laser Lu@discussions.microsoft.com> wrote in message
news:638A4ED2-F1AD-4D6A-9D8F-300F0D5FF908@microsoft.com...
> Hi, all, I wonder that, between ArrayList and Hashtable, which one will
take the better execution efficiency?