map<char, string> m;
###插入
m.insert(pair<char,string>('a', "aaa")); ##返回一个<iter, bool>的pair
m.insert(make_pair<char,string>('a', "aaa"));
m['a'] = "a";
m.find('a') == m.end() # iter
m.count('a')
iter -> second
vector<int> inorder = {11,12,13,14,15,16}
unordered_map<int,int> map_in
for (int idx = 0; idx != inorder.size(); ++idx)
map_in[inorder[idx]] = idx;
map_in[12] == 1;
网友评论