Click here to Skip to main content
11,802,636 members (69,650 online)
Rate this: bad
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 2: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 at 5-Jan-12 16:05pm
Good answer, +5. Also added some links that may be useful.
Mehdi Gholam at 5-Jan-12 16:17pm
Thanks Mika
Espen Harlinn at 5-Jan-12 16:34pm
I agree, nice reply :)
Mehdi Gholam at 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 at 5-Jan-12 16:16pm
Mika Wendelius at 5-Jan-12 16:17pm
Thanks :)
Espen Harlinn at 5-Jan-12 16:35pm
Nice links :)
Mika Wendelius at 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
0 KrunalRohit 366
1 OriginalGriff 365
2 F-ES Sitecore 295
3 Afzaal Ahmad Zeeshan 230
4 CPallini 230
0 OriginalGriff 2,950
1 Maciej Los 1,910
2 KrunalRohit 1,862
3 CPallini 1,695
4 Richard MacCutchan 1,157

Advertise | Privacy | Mobile
Web02 | 2.8.151002.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