Click here to Skip to main content
Rate this: bad
good
Please Sign up or sign in to vote.
See more: 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
good
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.
  Permalink  
Comments
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
   
Cheers
Rate this: bad
good
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[^]
  Permalink  
Comments
Mehdi Gholam at 5-Jan-12 16:16pm
   
5'ed
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 OriginalGriff 7,903
1 Sergey Alexandrovich Kryukov 7,142
2 DamithSL 5,604
3 Manas Bhardwaj 4,986
4 Maciej Los 4,820


Advertise | Privacy | Mobile
Web03 | 2.8.1411023.1 | Last Updated 5 Jan 2012
Copyright © CodeProject, 1999-2014
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