Collections and Generics
普通集合类和泛型类的对比
| Type | Generic Type | Remark |
| ArrayList | List<> | |
| Queue | Queue<> | 队列,先入先出 |
| Stack | Stack<> | 栈,后进先出 |
| HashTable | Dictionary<> | 不能使用Index访问,通过Key的Hash值排序 |
| SortedList | SortedList<> | 通过Key值排序 |
| ListDictionary | Dictionary<> | 同HashTable基本相同,应用于元素很少时(小于10) |
| HybirdDictionary | Dictionary<> | 同HashTable基本相同,元素少时相当于ListDictionary,元素多时相当于HashTable |
| OrderedDictionary | Dictionary<> | 能够自由控制元素的顺序,能够使用Index访问 |
| N/A | SortedDictionary<> | |
| NameValueCollection | Dictionary<> | Key可以重复 |
| DictionaryEntry | NameValuePair<> | |
| StringCollection | List<String> | 只能存储String的ArrayList |
| StringDictionary | Dictionary<String> | 只能存储String的HashTable |
| N/A | LinkedList<> | 链表 |

浙公网安备 33010602011771号