C # collection class

Source: Internet
Author: User

In. there are many collection classes in netframework, such as array, arraylist, list, hashtable, and dictionary ), stack and queue)

Arraylist is a complex version of an array. The arraylist class provides some functions that are not provided in most collection classes but not provided by the array class. For example:

1. the array capacity is fixed, and the arraylist capacity is automatically expanded as needed. If the value of the arraylist. Capacity attribute is changed. The memory is automatically re-allocated and the elements are copied.

2. The Array Performance of a specific type (excluding objects) is better than that of arraylist. This is because the elements of arraylist belong to the object type, so binning and unboxing usually occur when storing or retrieving value types.

Array is in the system namespace, while arraylist is in the worker M. Collections namespace.

Hashtab has good performance.

Dictionry stores a key and Value

 

Comparison of hashtable and dictionry-> reference: http://blog.csdn.net/snlei/article/details/3939206

 

Msdn: http://msdn.microsoft.com/zh-cn/library/ybcx56wz.aspx

Good site: http://www.w3cschool.cc/csharp/csharp-tutorial.html

Http://www.iwms.net/n1167c13.aspx

Http://www.cnblogs.com/jesse2013/p/CollectionsInCSharp.html

C # collection class

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.