zoukankan      html  css  js  c++  java
  • List ArrayList LinkedList 集合三

    因为List是有顺序的说以API中定义了 方法来处理List

    Collections 接口:用于操作List集合有排序sort(list);查找int binarySearch(List,obj);copy(list,list1);方法

           用法:Collections.sort(list);

           由于List是不同步的,线程不安全的,当多个线程取List资源时易出错,Collections中有synchronizedList();方法将List变成个同步的List

    Comparable 接口:comparaTo方法判断集合中两个对象大小排序。

    ArrayList 数组的结构 读快改慢

    LinkedList 链表的结构 改快读慢

    Hash 哈希算法散列吗  的介于两者之间

  • 相关阅读:
    std::auto_ptr
    make_pair
    _stdcall与_cdecl(了解)
    函数名与函数指针(了解)
    空指针与野指针
    std::bind(二)
    C++ map 映照容器
    sql find duplicate
    数量
    sort sign numeric
  • 原文地址:https://www.cnblogs.com/weixiaole/p/3450047.html
Copyright © 2011-2022 走看看