Click here to Skip to main content
15,898,134 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
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

Fully agree on Mehdi's solution. Also few links you may find useful:
- A Comparison of .NET Collections[^]
- Cheat Sheet: Speed of Common Operations[^]
 
Share this answer
 
Comments
Mehdi Gholam 5-Jan-12 16:16pm    
5'ed
Wendelius 5-Jan-12 16:17pm    
Thanks :)
Espen Harlinn 5-Jan-12 16:35pm    
Nice links :)
Wendelius 5-Jan-12 17:03pm    
Thanks :)
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.
 
Share this answer
 
Comments
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    
Cheers

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



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900