zoukankan      html  css  js  c++  java
  • C++ primer 11章关联容器

    • map
    • set
    • multimap (关键字可重复出现)
    • multiset 

    无序

    • unordered_map  (用哈希函数组织的map)
    • unordered_set
    • unordered_multimap
    • unordered_multiset

    pair 类型: utility

    pair<string, string> a;

    插入元素:

    set.insert();

    map.insert({a, b});

    map.insert(make_pair(a,b));

    insert(pair<string, stirng>(a,b))

    map.insert(map<string, string> :: value_type(a,b))

    multimap 中find 返回一组iterator 值:

    int c= m.cound(a);

    iter=m.find(a);

    while(c){

    ++ iter;

    -- c;

    }

    无序容器: 使用哈希函数, 维护元素的序代价很高, 无序很有用

  • 相关阅读:
    MySQL Create table as / Create table like
    Oracle CAST() 函数 数据类型的转换
    day 12
    day 11
    day 10
    day 9
    day 8
    day 7
    day 6
    day 5
  • 原文地址:https://www.cnblogs.com/fanhaha/p/7420832.html
Copyright © 2011-2022 走看看