加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 百科 > 正文

C#常用集合

发布时间:2020-12-16 01:19:26 所属栏目:百科 来源:网络整理
导读:数组的缺点:长度固定。因此引入集合的使用。 注:泛型集合更安全,性能更高。 常用集合 对应泛型 ①动态数组 ArrayList??? ListT 常用方法属性:Add? Clear? Contains? IndexOf? Insert? Remove? Sort ②哈希表 Hashtable ? DictionaryTKey,TValue 常用方法

数组的缺点:长度固定。因此引入集合的使用。

注:泛型集合更安全,性能更高。

常用集合      对应泛型

①动态数组ArrayList??? List<T>

常用方法属性:Add? Clear? Contains? IndexOf? Insert? Remove? Sort

②哈希表Hashtable ? Dictionary<TKey,TValue>

常用方法属性:Add? Clear? ContainsKey? ContainsValue? Remove

③排序列表SortedList? SortedList<TKey,TValue>?

常用方法属性:Add? Clear? ContainsKey? ContainsValue? GetByIndex? GetKey ?? Remove

④堆栈Stack    ?? Stack<T>

常用方法属性:Clear? Contains? Peek? Pop? Push? ToArray

⑤队列Queue    ? Queue<T>

常用方法属性:Clear? Contains? Dequeue? Enqueue? ToArray

⑥点阵列BitArray  

常用方法属性:And? Get? Not? Or? Set? SetAll? Xor?

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读