上一页 1 ··· 19 20 21 22 23 24 25 26 27 ··· 68 下一页
摘要: 1 #include 2 #include 3 //用于计算,计算的性能高于vector与array 4 #include 5 #include 6 using namespace std; 7 8 9 void main() 10 { 11 const double PI = 3.1415926; 12 valarray val(9); 13 ... 阅读全文
posted @ 2018-03-23 12:37 喵小喵~ 阅读(168) 评论(0) 推荐(0) 编辑
摘要: 1 #include 2 #include 3 //查询性能最高 4 //允许重复的,hash_map 5 #include 6 #include 7 using namespace std; 8 9 10 void main() 11 { 12 //允许重复的映射 13 unordered_multimapmymap{ {"a1",113},{ "... 阅读全文
posted @ 2018-03-23 12:33 喵小喵~ 阅读(1347) 评论(0) 推荐(0) 编辑
摘要: 1 #include 2 #include 3 //查询性能最高 4 //增删查改与map是一样的,但是本质区别就是unordered_map底层是hash表,map底层是红黑树 5 #include 6 using namespace std; 7 8 9 void main() 10 { 11 unordered_mapmymap{ {"a1",113},... 阅读全文
posted @ 2018-03-23 12:27 喵小喵~ 阅读(853) 评论(0) 推荐(0) 编辑
摘要: 1 #include 2 #include 3 //查询性能最高(不允许重复数据) 4 #include 5 using namespace std; 6 7 8 void main() 9 { 10 unordered_set myset{"move","jump","hello"}; 11 12 //删除hash表第一个 13 //my... 阅读全文
posted @ 2018-03-23 12:16 喵小喵~ 阅读(328) 评论(0) 推荐(0) 编辑
摘要: 1 #include 2 #include 3 #include 4 using namespace std; 5 6 7 void main() 8 { 9 multimapmymap; 10 mymap.insert(pair("司令1", 10)); 11 mymap.insert(pair("司令1", 11)); 12 mym... 阅读全文
posted @ 2018-03-23 10:20 喵小喵~ 阅读(120) 评论(0) 推荐(0) 编辑
摘要: 1 #include 2 #include 3 #include 4 using namespace std; 5 6 //map常规用法 7 void main1() 8 { 9 //映射 10 map mymap; 11 mymap.insert(pair("司令6", 16)); 12 mymap.insert(pair("司令2"... 阅读全文
posted @ 2018-03-23 10:15 喵小喵~ 阅读(130) 评论(0) 推荐(0) 编辑
摘要: 1 #define _SILENCE_STDEXT_HASH_DEPRECATION_WARNINGS 2 #include 3 #include 4 #include 5 #include 6 #include 7 using namespace std; 8 9 //hash_set常规用法 10 void main() 11 { 12 ////哈希表不... 阅读全文
posted @ 2018-03-22 23:23 喵小喵~ 阅读(241) 评论(0) 推荐(0) 编辑
摘要: 1 #include 2 //红黑树(自动保证平衡,自动生成平衡查找树) 3 #include 4 #include 5 #include 6 using namespace std; 7 8 9 void main() 10 { 11 //红黑树,每一个结点都是一个链表的头结点 12 multiset myset{ 1,2,3,3,3,3,4 };... 阅读全文
posted @ 2018-03-22 22:47 喵小喵~ 阅读(141) 评论(0) 推荐(0) 编辑
摘要: 1 #include 2 //红黑树(自动保证平衡,自动生成平衡查找树) 3 #include 4 #include 5 #include 6 using namespace std; 7 8 //红黑树增删查改 9 void main1() 10 { 11 set myset{ 1,2,10,3,5 }; 12 myset.insert(14); 1... 阅读全文
posted @ 2018-03-22 22:39 喵小喵~ 阅读(150) 评论(0) 推荐(0) 编辑
摘要: 1 #include 2 //string的本质也是容器 3 #include 4 #include 5 using namespace std; 6 7 void main() 8 { 9 string str1 = "1234"; 10 string str2 = "345"; 11 string str3 = str1 + str2; 12... 阅读全文
posted @ 2018-03-22 22:24 喵小喵~ 阅读(149) 评论(0) 推荐(0) 编辑
上一页 1 ··· 19 20 21 22 23 24 25 26 27 ··· 68 下一页