Click here to Skip to main content
11,927,711 members (39,234 online)
Rate this:
Please Sign up or sign in to vote.
See more: VB collections VB.NET
Hello All,

I got some concepts regarding arraylist, hashtable, stack, queue, namevaluecollections.

Could anyone tell me the practical applications of each.

I tried in google but could find exact match.

Thanks for your time.
Posted 5-Jan-12 3:35am
Rate this: bad
Please Sign up or sign in to vote.

Solution 1

ArrayList is a collection for any type of object, which should not be used because of boxing and unboxing performance, you should use List<T> instead. You usually use this for storing and iterating over as is.

Hashtable is a collection for rapid storing and retrieval based on the key.

Stack is a Last in First Out structure.

Queue is a First in First Out structure.

NameValueCollection or Dictionary is much like a HashTable.
Mika Wendelius 5-Jan-12 16:05pm
Good answer, +5. Also added some links that may be useful.
Mehdi Gholam 5-Jan-12 16:17pm
Thanks Mika
Espen Harlinn 5-Jan-12 16:34pm
I agree, nice reply :)
Mehdi Gholam 5-Jan-12 17:01pm
Rate this: bad
Please Sign up or sign in to vote.

Solution 2

Fully agree on Mehdi's solution. Also few links you may find useful:
- A Comparison of .NET Collections[^]
- Cheat Sheet: Speed of Common Operations[^]
Mehdi Gholam 5-Jan-12 16:16pm
Mika Wendelius 5-Jan-12 16:17pm
Thanks :)
Espen Harlinn 5-Jan-12 16:35pm
Nice links :)
Mika Wendelius 5-Jan-12 17:03pm
Thanks :)

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
Top Experts
Last 24hrsThis month

Advertise | Privacy | Mobile
Web02 | 2.8.151126.1 | Last Updated 5 Jan 2012
Copyright © CodeProject, 1999-2015
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100