zoukankan      html  css  js  c++  java
  • 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<> 链表
  • 相关阅读:
    MVC模式的学生信息增删改查
    常用排序算法
    2803 爱丽丝·玛格特罗依德
    3118 高精度练习之除法
    中秋练习题
    poj2011
    P1558 色板游戏
    P1830 轰炸III
    P1656 炸铁路
    1067 机器翻译
  • 原文地址:https://www.cnblogs.com/celery94/p/1505152.html
Copyright © 2011-2022 走看看