{"id":100697,"date":"2022-04-07T11:14:32","date_gmt":"2022-04-07T03:14:32","guid":{"rendered":"http:\/\/www.zhushiyao.com\/?p=100697"},"modified":"2022-04-07T11:16:14","modified_gmt":"2022-04-07T03:16:14","slug":"0d15077144","status":"publish","type":"post","link":"http:\/\/www.zhushiyao.com\/?p=100697","title":{"rendered":"STL\u603b\u7ed3\u4e0e\u5e38\u89c1\u9762\u8bd5\u9898"},"content":{"rendered":"<div class=\"bpp-post-content\">\n<p style=\"text-align: center; margin-bottom: 0em;\">\n<section style=\"font-size: 16px; color: black; padding-right: 10px; padding-left: 10px; line-height: 1.6; letter-spacing: 0px; word-break: break-word; overflow-wrap: break-word; text-align: left; font-family: Optima-Regular, Optima, PingFangSC-light, PingFangTC-light, 'PingFang SC', Cambria, Cochin, Georgia, Times, 'Times New Roman', serif; margin-top: -10px;\">\n<h2 style=\"margin-top: 30px; margin-bottom: 15px; font-weight: bold; border-bottom: 2px solid #ef7060; font-size: 1.3em;\"><span style=\"display: inline-block; background: #ef7060; color: #ffffff; padding: 3px 10px 1px; border-top-right-radius: 3px; border-top-left-radius: 3px; margin-right: 3px;\">1 STL\u6982\u8ff0<\/span><\/h2>\n<p style=\"padding-top: 8px; padding-bottom: 8px; line-height: 26px;\">\u4e3a\u4e86\u5efa\u7acb\u6570\u636e\u7ed3\u6784\u548c\u7b97\u6cd5\u7684\u4e00\u5957\u6807\u51c6\uff0c\u5e76\u4e14\u964d\u4f4e\u4ed6\u4eec\u4e4b\u95f4\u7684\u8026\u5408\u5173\u7cfb\uff0c\u4ee5\u63d0\u5347\u5404\u81ea\u7684\u72ec\u7acb\u6027\u3001\u5f39\u6027\u3001\u4ea4\u4e92\u64cd\u4f5c\u6027(\u76f8\u4e92\u5408\u4f5c\u6027,interoperability),\u8bde\u751f\u4e86STL\u3002<\/p>\n<p style=\"padding-top: 8px; padding-bottom: 8px; line-height: 26px;\">STL\u63d0\u4f9b\u4e86\u516d\u5927\u7ec4\u4ef6\uff0c\u5f7c\u6b64\u4e4b\u95f4\u53ef\u4ee5\u7ec4\u5408\u5957\u7528\uff0c\u8fd9\u516d\u5927\u7ec4\u4ef6\u5206\u522b\u662f:<strong>\u5bb9\u5668\u3001\u7b97\u6cd5\u3001\u8fed\u4ee3\u5668\u3001\u4eff\u51fd\u6570\u3001\u9002\u914d\u5668\uff08\u914d\u63a5\u5668\uff09\u3001\u7a7a\u95f4\u914d\u7f6e\u5668<\/strong>\u3002<\/p>\n<ul class=\"list-paddingleft-1\" style=\"margin-top: 8px; margin-bottom: 8px; padding-left: 25px;\">\n<li>\n<section style=\"margin-top: 5px; margin-bottom: 5px; line-height: 26px; color: #010101;\">\n<p style=\"padding-top: 8px; padding-bottom: 8px; line-height: 26px; color: black;\"><strong>\u5bb9\u5668<\/strong>\uff1a\u5404\u79cd\u6570\u636e\u7ed3\u6784\uff0c\u5982vector\u3001list\u3001deque\u3001set\u3001map\u7b49,\u7528\u6765\u5b58\u653e\u6570\u636e\uff0c\u4ece\u5b9e\u73b0\u89d2\u5ea6\u6765\u770b\uff0cSTL\u5bb9\u5668\u662f\u4e00\u79cdclass template\u3002<\/p>\n<\/section>\n<\/li>\n<li>\n<section style=\"margin-top: 5px; margin-bottom: 5px; line-height: 26px; color: #010101;\">\n<p style=\"padding-top: 8px; padding-bottom: 8px; line-height: 26px; color: black;\"><strong>\u7b97\u6cd5<\/strong>\uff1a\u5404\u79cd\u5e38\u7528\u7684\u7b97\u6cd5\uff0c\u5982sort\u3001find\u3001copy\u3001for_each\u3002\u4ece\u5b9e\u73b0\u7684\u89d2\u5ea6\u6765\u770b\uff0cSTL\u7b97\u6cd5\u662f\u4e00\u79cdfunction tempalte.<\/p>\n<\/section>\n<\/li>\n<li>\n<section style=\"margin-top: 5px; margin-bottom: 5px; line-height: 26px; color: #010101;\">\n<p style=\"padding-top: 8px; padding-bottom: 8px; line-height: 26px; color: black;\"><strong>\u8fed\u4ee3\u5668<\/strong>\uff1a\u626e\u6f14\u4e86\u5bb9\u5668\u4e0e\u7b97\u6cd5\u4e4b\u95f4\u7684\u80f6\u5408\u5242\uff0c\u5171\u6709\u4e94\u79cd\u7c7b\u578b\uff0c\u4ece\u5b9e\u73b0\u89d2\u5ea6\u6765\u770b\uff0c\u8fed\u4ee3\u5668\u662f\u4e00\u79cd\u5c06operator* , operator-&gt; , operator++,operator\u2013\u7b49\u6307\u9488\u76f8\u5173\u64cd\u4f5c\u4e88\u4ee5\u91cd\u8f7d\u7684class template. \u6240\u6709STL\u5bb9\u5668\u90fd\u9644\u5e26\u6709\u81ea\u5df1\u4e13\u5c5e\u7684\u8fed\u4ee3\u5668\uff0c\u53ea\u6709\u5bb9\u5668\u7684\u8bbe\u8ba1\u8005\u624d\u77e5\u9053\u5982\u4f55\u904d\u5386\u81ea\u5df1\u7684\u5143\u7d20\u3002\u539f\u751f\u6307\u9488(native pointer)\u4e5f\u662f\u4e00\u79cd\u8fed\u4ee3\u5668\u3002<\/p>\n<\/section>\n<\/li>\n<li>\n<section style=\"margin-top: 5px; margin-bottom: 5px; line-height: 26px; color: #010101;\">\n<p style=\"padding-top: 8px; padding-bottom: 8px; line-height: 26px; color: black;\"><strong>\u4eff\u51fd\u6570<\/strong>\uff1a\u884c\u4e3a\u7c7b\u4f3c\u51fd\u6570\uff0c\u53ef\u4f5c\u4e3a\u7b97\u6cd5\u7684\u67d0\u79cd\u7b56\u7565\u3002\u4ece\u5b9e\u73b0\u89d2\u5ea6\u6765\u770b\uff0c\u4eff\u51fd\u6570\u662f\u4e00\u79cd\u91cd\u8f7d\u4e86operator()\u7684class \u6216\u8005class template<\/p>\n<\/section>\n<\/li>\n<li>\n<section style=\"margin-top: 5px; margin-bottom: 5px; line-height: 26px; color: #010101;\">\n<p style=\"padding-top: 8px; padding-bottom: 8px; line-height: 26px; color: black;\"><strong>\u9002\u914d\u5668<\/strong>\uff1a\u4e00\u79cd\u7528\u6765\u4fee\u9970\u5bb9\u5668\u6216\u8005\u4eff\u51fd\u6570\u6216\u8fed\u4ee3\u5668\u63a5\u53e3\u7684\u4e1c\u897f\u3002<\/p>\n<\/section>\n<\/li>\n<li>\n<section style=\"margin-top: 5px; margin-bottom: 5px; line-height: 26px; color: #010101;\">\n<p style=\"padding-top: 8px; padding-bottom: 8px; line-height: 26px; color: black;\"><strong>\u7a7a\u95f4\u914d\u7f6e\u5668<\/strong>\uff1a\u8d1f\u8d23\u7a7a\u95f4\u7684\u914d\u7f6e\u4e0e\u7ba1\u7406\u3002\u4ece\u5b9e\u73b0\u89d2\u5ea6\u770b\uff0c\u914d\u7f6e\u5668\u662f\u4e00\u4e2a\u5b9e\u73b0\u4e86\u52a8\u6001\u7a7a\u95f4\u914d\u7f6e\u3001\u7a7a\u95f4\u7ba1\u7406\u3001\u7a7a\u95f4\u91ca\u653e\u7684class tempalte.<\/p>\n<\/section>\n<\/li>\n<\/ul>\n<p style=\"padding-top: 8px; padding-bottom: 8px; line-height: 26px;\">STL\u516d\u5927\u7ec4\u4ef6\u7684\u4ea4\u4e92\u5173\u7cfb\uff0c\u5bb9\u5668\u901a\u8fc7\u7a7a\u95f4\u914d\u7f6e\u5668\u53d6\u5f97\u6570\u636e\u5b58\u50a8\u7a7a\u95f4\uff0c\u7b97\u6cd5\u901a\u8fc7\u8fed\u4ee3\u5668\u5b58\u50a8\u5bb9\u5668\u4e2d\u7684\u5185\u5bb9\uff0c\u4eff\u51fd\u6570\u53ef\u4ee5\u534f\u52a9\u7b97\u6cd5\u5b8c\u6210\u4e0d\u540c\u7684\u7b56\u7565\u7684\u53d8\u5316\uff0c\u9002\u914d\u5668\u53ef\u4ee5\u4fee\u9970\u4eff\u51fd\u6570\u3002<\/p>\n<h2 style=\"margin-top: 30px; margin-bottom: 15px; font-weight: bold; border-bottom: 2px solid #ef7060; font-size: 1.3em;\"><span style=\"display: inline-block; background: #ef7060; color: #ffffff; padding: 3px 10px 1px; border-top-right-radius: 3px; border-top-left-radius: 3px; margin-right: 3px;\">2 STL\u7684\u4f18\u70b9\uff1a<\/span><\/h2>\n<ol class=\"list-paddingleft-1\" style=\"margin-top: 8px; margin-bottom: 8px; padding-left: 25px;\">\n<li>\n<section style=\"margin-top: 5px; margin-bottom: 5px; line-height: 26px; color: #010101;\">STL \u662f C++\u7684\u4e00\u90e8\u5206\uff0c\u56e0\u6b64\u4e0d\u7528\u989d\u5916\u5b89\u88c5\u4ec0\u4e48\uff0c\u5b83\u88ab\u5185\u5efa\u5728\u4f60\u7684\u7f16\u8bd1\u5668\u4e4b\u5185\u3002<\/section>\n<\/li>\n<li>\n<section style=\"margin-top: 5px; margin-bottom: 5px; line-height: 26px; color: #010101;\">STL \u7684\u4e00\u4e2a\u91cd\u8981\u7279\u6027\u662f\u5c06\u6570\u636e\u548c\u64cd\u4f5c\u5206\u79bb\u3002\u6570\u636e\u7531\u5bb9\u5668\u7c7b\u522b\u52a0\u4ee5\u7ba1\u7406\uff0c\u64cd\u4f5c\u5219\u7531\u53ef\u5b9a\u5236\u7684\u7b97\u6cd5\u5b9a\u4e49\u3002\u8fed\u4ee3\u5668\u5728\u4e24\u8005\u4e4b\u95f4\u5145\u5f53\u201c\u7c98\u5408\u5242\u201d,\u4ee5\u4f7f\u7b97\u6cd5\u53ef\u4ee5\u548c\u5bb9\u5668\u4ea4\u4e92\u8fd0\u4f5c<\/section>\n<\/li>\n<li>\n<section style=\"margin-top: 5px; margin-bottom: 5px; line-height: 26px; color: #010101;\">\u7a0b\u5e8f\u5458\u53ef\u4ee5\u4e0d\u7528\u601d\u8003 STL \u5177\u4f53\u7684\u5b9e\u73b0\u8fc7\u7a0b\uff0c\u53ea\u8981\u80fd\u591f\u719f\u7ec3\u4f7f\u7528 STL \u5c31 OK \u4e86\u3002\u8fd9\u6837\u4ed6\u4eec\u5c31\u53ef\u4ee5\u628a\u7cbe\u529b\u653e\u5728\u7a0b\u5e8f\u5f00\u53d1\u7684\u522b\u7684\u65b9\u9762\u3002<\/section>\n<\/li>\n<li>\n<section style=\"margin-top: 5px; margin-bottom: 5px; line-height: 26px; color: #010101;\">STL \u5177\u6709\u9ad8\u53ef\u91cd\u7528\u6027\uff0c\u9ad8\u6027\u80fd\uff0c\u9ad8\u79fb\u690d\u6027\uff0c\u8de8\u5e73\u53f0\u7684\u4f18\u70b9\u3002<\/section>\n<\/li>\n<li>\n<section style=\"margin-top: 5px; margin-bottom: 5px; line-height: 26px; color: #010101;\">\u9ad8\u53ef\u91cd\u7528\u6027\uff1aSTL \u4e2d\u51e0\u4e4e\u6240\u6709\u7684\u4ee3\u7801\u90fd\u91c7\u7528\u4e86\u6a21\u677f\u7c7b\u548c\u6a21\u7248\u51fd\u6570\u7684\u65b9\u5f0f\u5b9e\u73b0\uff0c\u8fd9\u76f8\u6bd4\u4e8e\u4f20\u7edf\u7684\u7531\u51fd\u6570\u548c\u7c7b\u7ec4\u6210\u7684\u5e93\u6765\u8bf4\u63d0\u4f9b\u4e86\u66f4\u597d\u7684\u4ee3\u7801\u91cd\u7528\u673a\u4f1a\u3002<\/section>\n<\/li>\n<li>\n<section style=\"margin-top: 5px; margin-bottom: 5px; line-height: 26px; color: #010101;\">\u9ad8\u6027\u80fd\uff1a\u5982 map \u53ef\u4ee5\u9ad8\u6548\u5730\u4ece\u5341\u4e07\u6761\u8bb0\u5f55\u91cc\u9762\u67e5\u627e\u51fa\u6307\u5b9a\u7684\u8bb0\u5f55\uff0c\u56e0\u4e3a map \u662f\u91c7\u7528\u7ea2\u9ed1\u6811\u7684\u53d8\u4f53\u5b9e\u73b0\u7684\u3002<\/section>\n<\/li>\n<li>\n<section style=\"margin-top: 5px; margin-bottom: 5px; line-height: 26px; color: #010101;\">\u9ad8\u79fb\u690d\u6027\uff1a\u5982\u5728\u9879\u76ee A \u4e0a\u7528 STL \u7f16\u5199\u7684\u6a21\u5757\uff0c\u53ef\u4ee5\u76f4\u63a5\u79fb\u690d\u5230\u9879\u76ee B \u4e0a\u3002\u5bb9\u5668\u548c\u7b97\u6cd5\u4e4b\u95f4\u901a\u8fc7\u8fed\u4ee3\u5668\u8fdb\u884c\u65e0\u7f1d\u8fde\u63a5\u3002STL \u51e0\u4e4e\u6240\u6709\u7684\u4ee3\u7801\u90fd\u91c7\u7528\u4e86\u6a21\u677f\u7c7b\u6216\u8005\u6a21\u677f\u51fd\u6570\uff0c\u8fd9\u76f8\u6bd4\u4f20\u7edf\u7684\u7531\u51fd\u6570\u548c\u7c7b\u7ec4\u6210\u7684\u5e93\u6765\u8bf4\u63d0\u4f9b\u4e86\u66f4\u597d\u7684\u4ee3\u7801\u91cd\u7528\u673a\u4f1a\u3002<\/section>\n<\/li>\n<\/ol>\n<h2 style=\"margin-top: 30px; margin-bottom: 15px; font-weight: bold; border-bottom: 2px solid #ef7060; font-size: 1.3em;\"><span style=\"display: inline-block; background: #ef7060; color: #ffffff; padding: 3px 10px 1px; border-top-right-radius: 3px; border-top-left-radius: 3px; margin-right: 3px;\">3 \u5bb9\u5668<\/span><\/h2>\n<p style=\"padding-top: 8px; padding-bottom: 8px; line-height: 26px;\">STL\u5bb9\u5668\u5c31\u662f\u5c06\u8fd0\u7528\u6700\u5e7f\u6cdb\u7684\u4e00\u4e9b\u6570\u636e\u7ed3\u6784\u5b9e\u73b0\u51fa\u6765\u3002<\/p>\n<p style=\"padding-top: 8px; padding-bottom: 8px; line-height: 26px;\">\u5e38\u7528\u7684\u6570\u636e\u7ed3\u6784\uff1a\u6570\u7ec4(array) , \u94fe\u8868(list), tree(\u6811)\uff0c\u6808(stack), \u961f\u5217(queue), \u96c6\u5408(set),\u6620\u5c04\u8868(map), \u6839\u636e\u6570\u636e\u5728\u5bb9\u5668\u4e2d\u7684\u6392\u5217\u7279\u6027\uff0c\u8fd9\u4e9b\u6570\u636e\u5206\u4e3a\u5e8f\u5217\u5f0f\u5bb9\u5668\u548c\u5173\u8054\u5f0f\u5bb9\u5668\u4e24\u79cd\u3002<\/p>\n<p style=\"padding-top: 8px; padding-bottom: 8px; line-height: 26px;\"><strong>\u5e8f\u5217\u5f0f\u5bb9\u5668<\/strong>\u5f3a\u8c03\u503c\u7684\u6392\u5e8f\uff0c\u5e8f\u5217\u5f0f\u5bb9\u5668\u4e2d\u7684\u6bcf\u4e2a\u5143\u7d20\u5747\u6709\u56fa\u5b9a\u7684\u4f4d\u7f6e\uff0c\u9664\u975e\u7528\u5220\u9664\u6216\u63d2\u5165\u7684\u64cd\u4f5c\u6539\u53d8\u8fd9\u4e2a\u4f4d\u7f6e\u3002Vector\u5bb9\u5668\u3001Deque\u5bb9\u5668\u3001List\u5bb9\u5668\u7b49\u3002<\/p>\n<p style=\"padding-top: 8px; padding-bottom: 8px; line-height: 26px;\"><strong>\u5173\u8054\u5f0f\u5bb9\u5668<\/strong>\u662f\u975e\u7ebf\u6027\u7684\u6811\u7ed3\u6784\uff0c\u66f4\u51c6\u786e\u7684\u8bf4\u662f\u4e8c\u53c9\u6811\u7ed3\u6784\u3002\u5404\u5143\u7d20\u4e4b\u95f4\u6ca1\u6709\u4e25\u683c\u7684\u7269\u7406\u4e0a\u7684\u987a\u5e8f\u5173\u7cfb\uff0c\u4e5f\u5c31\u662f\u8bf4\u5143\u7d20\u5728\u5bb9\u5668\u4e2d\u5e76\u6ca1\u6709\u4fdd\u5b58\u5143\u7d20\u7f6e\u5165\u5bb9\u5668\u65f6\u7684\u903b\u8f91\u987a\u5e8f\u3002\u5173\u8054\u5f0f\u5bb9\u5668\u53e6\u4e00\u4e2a\u663e\u8457\u7279\u70b9\u662f\uff1a\u5728\u503c\u4e2d\u9009\u62e9\u4e00\u4e2a\u503c\u4f5c\u4e3a\u5173\u952e\u5b57key\uff0c\u8fd9\u4e2a\u5173\u952e\u5b57\u5bf9\u503c\u8d77\u5230\u7d22\u5f15\u7684\u4f5c\u7528\uff0c\u65b9\u4fbf\u67e5\u627e\u3002Set\/multiset\u5bb9\u5668 Map\/multimap\u5bb9\u5668<\/p>\n<table>\n<thead>\n<tr style=\"border-width: 1px 0px 0px; background-color: white; border-color: #cccccc initial initial initial; border-style: solid initial initial initial;\">\n<th style=\"border-top-width: 1px; border-color: #cccccc; background-color: #f0f0f0; text-align: left;\">\u5bb9\u5668<\/th>\n<th style=\"border-top-width: 1px; border-color: #cccccc; background-color: #f0f0f0; text-align: center;\">\u5e95\u5c42\u6570\u636e\u7ed3\u6784<\/th>\n<th style=\"border-top-width: 1px; border-color: #cccccc; background-color: #f0f0f0; text-align: right;\">\u65f6\u95f4\u590d\u6742\u5ea6<\/th>\n<th style=\"border-top-width: 1px; border-color: #cccccc; background-color: #f0f0f0; text-align: left;\">\u6709\u65e0\u5e8f<\/th>\n<th style=\"border-top-width: 1px; border-color: #cccccc; background-color: #f0f0f0; text-align: center;\">\u53ef\u4e0d\u53ef\u91cd\u590d<\/th>\n<\/tr>\n<\/thead>\n<tbody style=\"border: 0px initial initial;\">\n<tr style=\"border-width: 1px 0px 0px; background-color: white; border-color: #cccccc initial initial initial; border-style: solid initial initial initial;\">\n<td style=\"border-color: #cccccc;\">array<\/td>\n<td style=\"border-color: #cccccc; text-align: center;\">\u6570\u7ec4<\/td>\n<td style=\"border-color: #cccccc; text-align: right;\">\u968f\u673a\u8bfb\u6539 O(1)<\/td>\n<td style=\"border-color: #cccccc;\">\u65e0\u5e8f<\/td>\n<td style=\"border-color: #cccccc; text-align: center;\">\u53ef\u91cd\u590d<\/td>\n<\/tr>\n<tr style=\"border-width: 1px 0px 0px; background-color: #f8f8f8; border-color: #cccccc initial initial initial; border-style: solid initial initial initial;\">\n<td style=\"border-color: #cccccc;\">vector<\/td>\n<td style=\"border-color: #cccccc; text-align: center;\">\u6570\u7ec4<\/td>\n<td style=\"border-color: #cccccc; text-align: right;\">\u968f\u673a\u8bfb\u6539\u3001\u5c3e\u90e8\u63d2\u5165\u3001\u5c3e\u90e8\u5220\u9664 O(1)\u5934\u90e8\u63d2\u5165\u3001\u5934\u90e8\u5220\u9664 O(n)<\/td>\n<td style=\"border-color: #cccccc;\">\u65e0\u5e8f<\/td>\n<td style=\"border-color: #cccccc; text-align: center;\">\u53ef\u91cd\u590d<\/td>\n<\/tr>\n<tr style=\"border-width: 1px 0px 0px; background-color: white; border-color: #cccccc initial initial initial; border-style: solid initial initial initial;\">\n<td style=\"border-color: #cccccc;\">deque<\/td>\n<td style=\"border-color: #cccccc; text-align: center;\">\u53cc\u7aef\u961f\u5217<\/td>\n<td style=\"border-color: #cccccc; text-align: right;\">\u5934\u5c3e\u63d2\u5165\u3001\u5934\u5c3e\u5220\u9664 O(1)<\/td>\n<td style=\"border-color: #cccccc;\">\u65e0\u5e8f<\/td>\n<td style=\"border-color: #cccccc; text-align: center;\">\u53ef\u91cd\u590d<\/td>\n<\/tr>\n<tr style=\"border-width: 1px 0px 0px; background-color: #f8f8f8; border-color: #cccccc initial initial initial; border-style: solid initial initial initial;\">\n<td style=\"border-color: #cccccc;\">forward_list<\/td>\n<td style=\"border-color: #cccccc; text-align: center;\">\u5355\u5411\u94fe\u8868<\/td>\n<td style=\"border-color: #cccccc; text-align: right;\">\u63d2\u5165\u3001\u5220\u9664 O(1)<\/td>\n<td style=\"border-color: #cccccc;\">\u65e0\u5e8f<\/td>\n<td style=\"border-color: #cccccc; text-align: center;\">\u53ef\u91cd\u590d<\/td>\n<\/tr>\n<tr style=\"border-width: 1px 0px 0px; background-color: white; border-color: #cccccc initial initial initial; border-style: solid initial initial initial;\">\n<td style=\"border-color: #cccccc;\">list<\/td>\n<td style=\"border-color: #cccccc; text-align: center;\">\u53cc\u5411\u94fe\u8868<\/td>\n<td style=\"border-color: #cccccc; text-align: right;\">\u63d2\u5165\u3001\u5220\u9664 O(1)<\/td>\n<td style=\"border-color: #cccccc;\">\u65e0\u5e8f<\/td>\n<td style=\"border-color: #cccccc; text-align: center;\">\u53ef\u91cd\u590d<\/td>\n<\/tr>\n<tr style=\"border-width: 1px 0px 0px; background-color: #f8f8f8; border-color: #cccccc initial initial initial; border-style: solid initial initial initial;\">\n<td style=\"border-color: #cccccc;\">stack<\/td>\n<td style=\"border-color: #cccccc; text-align: center;\">deque \/ list<\/td>\n<td style=\"border-color: #cccccc; text-align: right;\">\u9876\u90e8\u63d2\u5165\u3001\u9876\u90e8\u5220\u9664 O(1)<\/td>\n<td style=\"border-color: #cccccc;\">\u65e0\u5e8f<\/td>\n<td style=\"border-color: #cccccc; text-align: center;\">\u53ef\u91cd\u590d<\/td>\n<\/tr>\n<tr style=\"border-width: 1px 0px 0px; background-color: white; border-color: #cccccc initial initial initial; border-style: solid initial initial initial;\">\n<td style=\"border-color: #cccccc;\">queue<\/td>\n<td style=\"border-color: #cccccc; text-align: center;\">deque \/ list<\/td>\n<td style=\"border-color: #cccccc; text-align: right;\">\u5c3e\u90e8\u63d2\u5165\u3001\u5934\u90e8\u5220\u9664 O(1)<\/td>\n<td style=\"border-color: #cccccc;\">\u65e0\u5e8f<\/td>\n<td style=\"border-color: #cccccc; text-align: center;\">\u53ef\u91cd\u590d<\/td>\n<\/tr>\n<tr style=\"border-width: 1px 0px 0px; background-color: #f8f8f8; border-color: #cccccc initial initial initial; border-style: solid initial initial initial;\">\n<td style=\"border-color: #cccccc;\">priority_queue<\/td>\n<td style=\"border-color: #cccccc; text-align: center;\">vector \/max-heap<\/td>\n<td style=\"border-color: #cccccc; text-align: right;\">\u63d2\u5165\u3001\u5220\u9664 O(log2n)<\/td>\n<td style=\"border-color: #cccccc;\">\u6709\u5e8f<\/td>\n<td style=\"border-color: #cccccc; text-align: center;\">\u53ef\u91cd\u590d<\/td>\n<\/tr>\n<tr style=\"border-width: 1px 0px 0px; background-color: white; border-color: #cccccc initial initial initial; border-style: solid initial initial initial;\">\n<td style=\"border-color: #cccccc;\">set<\/td>\n<td style=\"border-color: #cccccc; text-align: center;\">\u7ea2\u9ed1\u6811<\/td>\n<td style=\"border-color: #cccccc; text-align: right;\">\u63d2\u5165\u3001\u5220\u9664\u3001\u67e5\u627e O(log2n)<\/td>\n<td style=\"border-color: #cccccc;\">\u6709\u5e8f<\/td>\n<td style=\"border-color: #cccccc; text-align: center;\">\u4e0d\u53ef\u91cd\u590d<\/td>\n<\/tr>\n<tr style=\"border-width: 1px 0px 0px; background-color: #f8f8f8; border-color: #cccccc initial initial initial; border-style: solid initial initial initial;\">\n<td style=\"border-color: #cccccc;\">multiset<\/td>\n<td style=\"border-color: #cccccc; text-align: center;\">\u7ea2\u9ed1\u6811<\/td>\n<td style=\"border-color: #cccccc; text-align: right;\">\u63d2\u5165\u3001\u5220\u9664\u3001\u67e5\u627e O(log2n)<\/td>\n<td style=\"border-color: #cccccc;\">\u6709\u5e8f<\/td>\n<td style=\"border-color: #cccccc; text-align: center;\">\u53ef\u91cd\u590d<\/td>\n<\/tr>\n<tr style=\"border-width: 1px 0px 0px; background-color: white; border-color: #cccccc initial initial initial; border-style: solid initial initial initial;\">\n<td style=\"border-color: #cccccc;\">map<\/td>\n<td style=\"border-color: #cccccc; text-align: center;\">\u7ea2\u9ed1\u6811<\/td>\n<td style=\"border-color: #cccccc; text-align: right;\">\u63d2\u5165\u3001\u5220\u9664\u3001\u67e5\u627e O(log2n)<\/td>\n<td style=\"border-color: #cccccc;\">\u6709\u5e8f<\/td>\n<td style=\"border-color: #cccccc; text-align: center;\">\u4e0d\u53ef\u91cd\u590d<\/td>\n<\/tr>\n<tr style=\"border-width: 1px 0px 0px; background-color: #f8f8f8; border-color: #cccccc initial initial initial; border-style: solid initial initial initial;\">\n<td style=\"border-color: #cccccc;\">multimap<\/td>\n<td style=\"border-color: #cccccc; text-align: center;\">\u7ea2\u9ed1\u6811<\/td>\n<td style=\"border-color: #cccccc; text-align: right;\">\u63d2\u5165\u3001\u5220\u9664\u3001\u67e5\u627e O(log2n)<\/td>\n<td style=\"border-color: #cccccc;\">\u6709\u5e8f<\/td>\n<td style=\"border-color: #cccccc; text-align: center;\">\u53ef\u91cd\u590d<\/td>\n<\/tr>\n<tr style=\"border-width: 1px 0px 0px; background-color: white; border-color: #cccccc initial initial initial; border-style: solid initial initial initial;\">\n<td style=\"border-color: #cccccc;\">unordered_set<\/td>\n<td style=\"border-color: #cccccc; text-align: center;\">\u54c8\u5e0c\u8868<\/td>\n<td style=\"border-color: #cccccc; text-align: right;\">\u63d2\u5165\u3001\u5220\u9664\u3001\u67e5\u627e O(1) \u6700\u5dee O(n)<\/td>\n<td style=\"border-color: #cccccc;\">\u65e0\u5e8f<\/td>\n<td style=\"border-color: #cccccc; text-align: center;\">\u4e0d\u53ef\u91cd\u590d<\/td>\n<\/tr>\n<tr style=\"border-width: 1px 0px 0px; background-color: #f8f8f8; border-color: #cccccc initial initial initial; border-style: solid initial initial initial;\">\n<td style=\"border-color: #cccccc;\">unordered_multiset<\/td>\n<td style=\"border-color: #cccccc; text-align: center;\">\u54c8\u5e0c\u8868<\/td>\n<td style=\"border-color: #cccccc; text-align: right;\">\u63d2\u5165\u3001\u5220\u9664\u3001\u67e5\u627e O(1) \u6700\u5dee O(n)<\/td>\n<td style=\"border-color: #cccccc;\">\u65e0\u5e8f<\/td>\n<td style=\"border-color: #cccccc; text-align: center;\">\u53ef\u91cd\u590d<\/td>\n<\/tr>\n<tr style=\"border-width: 1px 0px 0px; background-color: white; border-color: #cccccc initial initial initial; border-style: solid initial initial initial;\">\n<td style=\"border-color: #cccccc;\">unordered_map<\/td>\n<td style=\"border-color: #cccccc; text-align: center;\">\u54c8\u5e0c\u8868<\/td>\n<td style=\"border-color: #cccccc; text-align: right;\">\u63d2\u5165\u3001\u5220\u9664\u3001\u67e5\u627e O(1) \u6700\u5dee O(n)<\/td>\n<td style=\"border-color: #cccccc;\">\u65e0\u5e8f<\/td>\n<td style=\"border-color: #cccccc; text-align: center;\">\u4e0d\u53ef\u91cd\u590d<\/td>\n<\/tr>\n<tr style=\"border-width: 1px 0px 0px; background-color: #f8f8f8; border-color: #cccccc initial initial initial; border-style: solid initial initial initial;\">\n<td style=\"border-color: #cccccc;\">unordered_multimap<\/td>\n<td style=\"border-color: #cccccc; text-align: center;\">\u54c8\u5e0c\u8868<\/td>\n<td style=\"border-color: #cccccc; text-align: right;\">\u63d2\u5165\u3001\u5220\u9664\u3001\u67e5\u627e O(1) \u6700\u5dee O(n)<\/td>\n<td style=\"border-color: #cccccc;\">\u65e0\u5e8f<\/td>\n<td style=\"border-color: #cccccc; text-align: center;\">\u53ef\u91cd\u590d<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<h3 style=\"margin-top: 30px; margin-bottom: 15px; font-weight: bold; font-size: 20px;\">1 array<\/h3>\n<p style=\"padding-top: 8px; padding-bottom: 8px; line-height: 26px;\">array \u662f\u56fa\u5b9a\u5927\u5c0f\u7684\u987a\u5e8f\u5bb9\u5668\uff0c\u5b83\u4eec\u4fdd\u5b58\u4e86\u4e00\u4e2a\u4ee5\u4e25\u683c\u7684\u7ebf\u6027\u987a\u5e8f\u6392\u5217\u7684\u7279\u5b9a\u6570\u91cf\u7684\u5143\u7d20\u3002<\/p>\n<table>\n<thead>\n<tr style=\"border-width: 1px 0px 0px; background-color: white; border-color: #cccccc initial initial initial; border-style: solid initial initial initial;\">\n<th style=\"border-top-width: 1px; border-color: #cccccc; background-color: #f0f0f0; text-align: left;\">\u65b9\u6cd5<\/th>\n<th style=\"border-top-width: 1px; border-color: #cccccc; background-color: #f0f0f0; text-align: center;\">\u8bf4\u660e<\/th>\n<\/tr>\n<\/thead>\n<tbody style=\"border: 0px initial initial;\">\n<tr style=\"border-width: 1px 0px 0px; background-color: white; border-color: #cccccc initial initial initial; border-style: solid initial initial initial;\">\n<td style=\"border-color: #cccccc;\">begin<\/td>\n<td style=\"border-color: #cccccc; text-align: center;\">\u8fd4\u56de\u6307\u5411\u6570\u7ec4\u5bb9\u5668\u4e2d\u7b2c\u4e00\u4e2a\u5143\u7d20\u7684\u8fed\u4ee3\u5668<\/td>\n<\/tr>\n<tr style=\"border-width: 1px 0px 0px; background-color: #f8f8f8; border-color: #cccccc initial initial initial; border-style: solid initial initial initial;\">\n<td style=\"border-color: #cccccc;\">end<\/td>\n<td style=\"border-color: #cccccc; text-align: center;\">\u8fd4\u56de\u6307\u5411\u6570\u7ec4\u5bb9\u5668\u4e2d\u6700\u540e\u4e00\u4e2a\u5143\u7d20\u4e4b\u540e\u7684\u7406\u8bba\u5143\u7d20\u7684\u8fed\u4ee3\u5668<\/td>\n<\/tr>\n<tr style=\"border-width: 1px 0px 0px; background-color: white; border-color: #cccccc initial initial initial; border-style: solid initial initial initial;\">\n<td style=\"border-color: #cccccc;\">rbegin<\/td>\n<td style=\"border-color: #cccccc; text-align: center;\">\u8fd4\u56de\u6307\u5411\u6570\u7ec4\u5bb9\u5668\u4e2d\u6700\u540e\u4e00\u4e2a\u5143\u7d20\u7684\u53cd\u5411\u8fed\u4ee3\u5668<\/td>\n<\/tr>\n<tr style=\"border-width: 1px 0px 0px; background-color: #f8f8f8; border-color: #cccccc initial initial initial; border-style: solid initial initial initial;\">\n<td style=\"border-color: #cccccc;\">rend<\/td>\n<td style=\"border-color: #cccccc; text-align: center;\">\u8fd4\u56de\u4e00\u4e2a\u53cd\u5411\u8fed\u4ee3\u5668\uff0c\u6307\u5411\u6570\u7ec4\u4e2d\u7b2c\u4e00\u4e2a\u5143\u7d20\u4e4b\u524d\u7684\u7406\u8bba\u5143\u7d20<\/td>\n<\/tr>\n<tr style=\"border-width: 1px 0px 0px; background-color: white; border-color: #cccccc initial initial initial; border-style: solid initial initial initial;\">\n<td style=\"border-color: #cccccc;\">cbegin<\/td>\n<td style=\"border-color: #cccccc; text-align: center;\">\u8fd4\u56de\u6307\u5411\u6570\u7ec4\u5bb9\u5668\u4e2d\u7b2c\u4e00\u4e2a\u5143\u7d20\u7684\u5e38\u91cf\u8fed\u4ee3\u5668\uff08const_iterator\uff09<\/td>\n<\/tr>\n<tr style=\"border-width: 1px 0px 0px; background-color: #f8f8f8; border-color: #cccccc initial initial initial; border-style: solid initial initial initial;\">\n<td style=\"border-color: #cccccc;\">cend<\/td>\n<td style=\"border-color: #cccccc; text-align: center;\">\u8fd4\u56de\u6307\u5411\u6570\u7ec4\u5bb9\u5668\u4e2d\u6700\u540e\u4e00\u4e2a\u5143\u7d20\u4e4b\u540e\u7684\u7406\u8bba\u5143\u7d20\u7684\u5e38\u91cf\u8fed\u4ee3\u5668\uff08const_iterator\uff09<\/td>\n<\/tr>\n<tr style=\"border-width: 1px 0px 0px; background-color: white; border-color: #cccccc initial initial initial; border-style: solid initial initial initial;\">\n<td style=\"border-color: #cccccc;\">crbegin<\/td>\n<td style=\"border-color: #cccccc; text-align: center;\">\u8fd4\u56de\u6307\u5411\u6570\u7ec4\u5bb9\u5668\u4e2d\u6700\u540e\u4e00\u4e2a\u5143\u7d20\u7684\u5e38\u91cf\u53cd\u5411\u8fed\u4ee3\u5668\uff08const_reverse_iterator\uff09<\/td>\n<\/tr>\n<tr style=\"border-width: 1px 0px 0px; background-color: #f8f8f8; border-color: #cccccc initial initial initial; border-style: solid initial initial initial;\">\n<td style=\"border-color: #cccccc;\">crend<\/td>\n<td style=\"border-color: #cccccc; text-align: center;\">\u8fd4\u56de\u6307\u5411\u6570\u7ec4\u4e2d\u7b2c\u4e00\u4e2a\u5143\u7d20\u4e4b\u524d\u7684\u7406\u8bba\u5143\u7d20\u7684\u5e38\u91cf\u53cd\u5411\u8fed\u4ee3\u5668\uff08const_reverse_iterator\uff09<\/td>\n<\/tr>\n<tr style=\"border-width: 1px 0px 0px; background-color: white; border-color: #cccccc initial initial initial; border-style: solid initial initial initial;\">\n<td style=\"border-color: #cccccc;\">size<\/td>\n<td style=\"border-color: #cccccc; text-align: center;\">\u8fd4\u56de\u6570\u7ec4\u5bb9\u5668\u4e2d\u5143\u7d20\u7684\u6570\u91cf<\/td>\n<\/tr>\n<tr style=\"border-width: 1px 0px 0px; background-color: #f8f8f8; border-color: #cccccc initial initial initial; border-style: solid initial initial initial;\">\n<td style=\"border-color: #cccccc;\">max_size<\/td>\n<td style=\"border-color: #cccccc; text-align: center;\">\u8fd4\u56de\u6570\u7ec4\u5bb9\u5668\u53ef\u5bb9\u7eb3\u7684\u6700\u5927\u5143\u7d20\u6570<\/td>\n<\/tr>\n<tr style=\"border-width: 1px 0px 0px; background-color: white; border-color: #cccccc initial initial initial; border-style: solid initial initial initial;\">\n<td style=\"border-color: #cccccc;\">empty<\/td>\n<td style=\"border-color: #cccccc; text-align: center;\">\u8fd4\u56de\u4e00\u4e2a\u5e03\u5c14\u503c\uff0c\u6307\u793a\u6570\u7ec4\u5bb9\u5668\u662f\u5426\u4e3a\u7a7a<\/td>\n<\/tr>\n<tr style=\"border-width: 1px 0px 0px; background-color: #f8f8f8; border-color: #cccccc initial initial initial; border-style: solid initial initial initial;\">\n<td style=\"border-color: #cccccc;\">operator[]<\/td>\n<td style=\"border-color: #cccccc; text-align: center;\">\u8fd4\u56de\u5bb9\u5668\u4e2d\u7b2c n\uff08\u53c2\u6570\uff09\u4e2a\u4f4d\u7f6e\u7684\u5143\u7d20\u7684\u5f15\u7528<\/td>\n<\/tr>\n<tr style=\"border-width: 1px 0px 0px; background-color: white; border-color: #cccccc initial initial initial; border-style: solid initial initial initial;\">\n<td style=\"border-color: #cccccc;\">at<\/td>\n<td style=\"border-color: #cccccc; text-align: center;\">\u8fd4\u56de\u5bb9\u5668\u4e2d\u7b2c n\uff08\u53c2\u6570\uff09\u4e2a\u4f4d\u7f6e\u7684\u5143\u7d20\u7684\u5f15\u7528<\/td>\n<\/tr>\n<tr style=\"border-width: 1px 0px 0px; background-color: #f8f8f8; border-color: #cccccc initial initial initial; border-style: solid initial initial initial;\">\n<td style=\"border-color: #cccccc;\">front<\/td>\n<td style=\"border-color: #cccccc; text-align: center;\">\u8fd4\u56de\u5bf9\u5bb9\u5668\u4e2d\u7b2c\u4e00\u4e2a\u5143\u7d20\u7684\u5f15\u7528<\/td>\n<\/tr>\n<tr style=\"border-width: 1px 0px 0px; background-color: white; border-color: #cccccc initial initial initial; border-style: solid initial initial initial;\">\n<td style=\"border-color: #cccccc;\">back<\/td>\n<td style=\"border-color: #cccccc; text-align: center;\">\u8fd4\u56de\u5bf9\u5bb9\u5668\u4e2d\u6700\u540e\u4e00\u4e2a\u5143\u7d20\u7684\u5f15\u7528<\/td>\n<\/tr>\n<tr style=\"border-width: 1px 0px 0px; background-color: #f8f8f8; border-color: #cccccc initial initial initial; border-style: solid initial initial initial;\">\n<td style=\"border-color: #cccccc;\">data<\/td>\n<td style=\"border-color: #cccccc; text-align: center;\">\u8fd4\u56de\u6307\u5411\u5bb9\u5668\u4e2d\u7b2c\u4e00\u4e2a\u5143\u7d20\u7684\u6307\u9488<\/td>\n<\/tr>\n<tr style=\"border-width: 1px 0px 0px; background-color: white; border-color: #cccccc initial initial initial; border-style: solid initial initial initial;\">\n<td style=\"border-color: #cccccc;\">fill<\/td>\n<td style=\"border-color: #cccccc; text-align: center;\">\u7528 val\uff08\u53c2\u6570\uff09\u586b\u5145\u6570\u7ec4\u6240\u6709\u5143\u7d20<\/td>\n<\/tr>\n<tr style=\"border-width: 1px 0px 0px; background-color: #f8f8f8; border-color: #cccccc initial initial initial; border-style: solid initial initial initial;\">\n<td style=\"border-color: #cccccc;\">swap<\/td>\n<td style=\"border-color: #cccccc; text-align: center;\">\u901a\u8fc7 x\uff08\u53c2\u6570\uff09\u7684\u5185\u5bb9\u4ea4\u6362\u6570\u7ec4\u7684\u5185\u5bb9<\/td>\n<\/tr>\n<tr style=\"border-width: 1px 0px 0px; background-color: white; border-color: #cccccc initial initial initial; border-style: solid initial initial initial;\">\n<td style=\"border-color: #cccccc;\">get\uff08array\uff09<\/td>\n<td style=\"border-color: #cccccc; text-align: center;\">\u5f62\u5982 std::get&lt;0&gt;(myarray)\uff1b\u4f20\u5165\u4e00\u4e2a\u6570\u7ec4\u5bb9\u5668\uff0c\u8fd4\u56de\u6307\u5b9a\u4f4d\u7f6e\u5143\u7d20\u7684\u5f15\u7528<\/td>\n<\/tr>\n<tr style=\"border-width: 1px 0px 0px; background-color: #f8f8f8; border-color: #cccccc initial initial initial; border-style: solid initial initial initial;\">\n<td style=\"border-color: #cccccc;\">relational operators (array)<\/td>\n<td style=\"border-color: #cccccc; text-align: center;\">\u5f62\u5982 arrayA &gt; arrayB\uff1b\u4f9d\u6b64\u6bd4\u8f83\u6570\u7ec4\u6bcf\u4e2a\u5143\u7d20\u7684\u5927\u5c0f\u5173\u7cfb<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<h3 style=\"margin-top: 30px; margin-bottom: 15px; font-weight: bold; font-size: 20px;\">\u6d4b\u8bd5\u4ee3\u7801<\/h3>\n<pre style=\"margin-top: 10px; margin-bottom: 10px; border-radius: 5px; box-shadow: rgba(0, 0, 0, 0.55) 0px 2px 10px;\"><code style=\"overflow-x: auto; padding: 16px; color: #abb2bf; display: -webkit-box; font-family: Operator Mono, Consolas, Monaco, Menlo, monospace; font-size: 12px; -webkit-overflow-scrolling: touch; padding-top: 15px; background: #282c34; border-radius: 5px;\">#include&lt;iostream&gt;\n#include&lt;array&gt;\nusing namespace std;\n\nint main() \n{\n\tarray&lt;int, 8&gt; myArr = {1,3,4,6,9};\/\/\u56fa\u5b9a\u5927\u5c0f\u4e3a8\n\tcout &lt;&lt; \"myArr\u5143\u7d20\u5e8f\u5217\uff1a\";\n\tfor (auto i = 0; i &lt; 8; ++i) \n\t{\n\t\tcout &lt;&lt; myArr[i] &lt;&lt; \" \";\n\t}\n\tcout &lt;&lt; endl;\n\n\tarray&lt;int, 8&gt; myArr1 = {2,3,4,7,8,9};\/\/\u56fa\u5b9a\u5927\u5c0f\u4e3a8\n\tcout &lt;&lt; \"myArr1\u5143\u7d20\u5e8f\u5217\uff1a\";\n\tfor (auto i = 0; i &lt; 8; ++i) \n\t{\n\t\tcout &lt;&lt; myArr1[i] &lt;&lt; \" \";\n\t}\n\tcout &lt;&lt; endl;\n\n\tmyArr.swap(myArr1);   \/\/\u4ea4\u6362\u4e24\u4e2a\u5bb9\u5668\u7684\u5185\u5bb9\n\tcout &lt;&lt; \"\u4ea4\u6362myArr\u4e0emyArr1\"&lt;&lt; endl;\n\tcout &lt;&lt; endl;\n\n\tcout &lt;&lt; \"myArr.at(3) = \" &lt;&lt; myArr.at(3) &lt;&lt; endl;\/\/\u4efb\u610f\u8bbf\u95ee\n\tcout &lt;&lt; \"myArr[3] = \" &lt;&lt; myArr[3] &lt;&lt; endl;\/\/\u4efb\u610f\u8bbf\u95ee\n\tcout &lt;&lt; \"myArr.front() = \" &lt;&lt; myArr.front() &lt;&lt; endl;\/\/\u83b7\u53d6\u7b2c\u4e00\u4e2a\u5143\u7d20\n\tcout &lt;&lt; \"myArr.back() =  \" &lt;&lt; myArr.back() &lt;&lt; endl;\/\/\u83b7\u53d6\u6700\u540e\u4e00\u4e2a\u5143\u7d20\n\tcout &lt;&lt; \"myArr.data() = \" &lt;&lt; myArr.data() &lt;&lt; endl;\/\/\u83b7\u53d6\u7b2c\u4e00\u4e2a\u5143\u7d20\u7684\u6307\u9488\n\tcout &lt;&lt; \"*myArr.data() = \" &lt;&lt; *myArr.data() &lt;&lt; endl;\/\/\u83b7\u53d6\u7b2c\u4e00\u4e2a\u5143\u7d20\u7684\u6307\u9488\u6307\u5411\u7684\u5143\u7d20\n\n\tcout &lt;&lt; \"\u6b63\u5411\u8fed\u4ee3\u5668\u904d\u5386\u5bb9\u5668\uff1a\";\n\tfor (auto it = myArr.begin(); it != myArr.end(); ++it) \n\t{\n\t\tcout &lt;&lt; *it &lt;&lt; \" \";\n\t}\n\tcout &lt;&lt; endl;\n\t\/\/\u9006\u5411\u8fed\u4ee3\u5668\u6d4b\u8bd5\n\tcout &lt;&lt; \"\u9006\u5411\u8fed\u4ee3\u5668\u904d\u5386\u5bb9\u5668\uff1a\";\n\tfor (auto rit = myArr.rbegin(); rit != myArr.rend(); ++rit) \n\t{\n\t\tcout &lt;&lt; *rit &lt;&lt; \" \";\n\t}\n\tcout &lt;&lt; endl;\n\t\/\/\u6b63\u5411\u5e38\u8fed\u4ee3\u5668\u6d4b\u8bd5\n\tcout &lt;&lt; \"\u6b63\u5411\u5e38\u8fed\u4ee3\u5668\u904d\u5386\u5bb9\u5668\uff1a\";\n\tfor (auto it = myArr.cbegin(); it != myArr.cend(); ++it) \n\t{\n\t\tcout &lt;&lt; *it &lt;&lt; \" \";\n\t}\n\tcout &lt;&lt; endl;\n\t\/\/\u9006\u5411\u5e38\u8fed\u4ee3\u5668\u6d4b\u8bd5\n\tcout &lt;&lt; \"\u9006\u5411\u5e38\u8fed\u4ee3\u5668\u904d\u5386\u5bb9\u5668\uff1a\";\n\tfor (auto rit = myArr.crbegin(); rit != myArr.crend(); ++rit) \n\t{\n\t\tcout &lt;&lt; *rit &lt;&lt; \" \";\n\t}\n\tcout &lt;&lt; endl;\n\tif(myArr.empty())\n\t\tcout &lt;&lt; \"myArr\u4e3a\u7a7a \" &lt;&lt; endl;\n\telse\n\t\tcout &lt;&lt; \"myArr\u4e0d\u4e3a\u7a7a \" &lt;&lt; endl;\n\tcout &lt;&lt; \"myArr.size() = \" &lt;&lt; myArr.size() &lt;&lt; endl;\n\tcout &lt;&lt; \"myArr.max_size() = \" &lt;&lt; myArr.max_size() &lt;&lt; endl;\n\n\treturn 0;\n}\n\n<\/code><\/pre>\n<h3 style=\"margin-top: 30px; margin-bottom: 15px; font-weight: bold; font-size: 20px;\">\u8fd0\u884c\u7ed3\u679c<\/h3>\n<figure style=\"margin-top: 10px; margin-bottom: 10px;\"><img decoding=\"async\" style=\"display: block; margin-right: auto; margin-left: auto;\" title=\"STL\u603b\u7ed3\u4e0e\u5e38\u89c1\u9762\u8bd5\u9898\" src=\"http:\/\/www.zhushiyao.com\/wp-content\/uploads\/2022\/04\/3-1649301272.png\" alt=\"STL\u603b\u7ed3\u4e0e\u5e38\u89c1\u9762\u8bd5\u9898\" \/><figcaption style=\"margin-top: 5px; text-align: center; color: #888; font-size: 14px;\">\u8fd0\u884c\u7ed3\u679c<\/figcaption><\/figure>\n<h3 style=\"margin-top: 30px; margin-bottom: 15px; font-weight: bold; font-size: 20px;\">vector<\/h3>\n<p style=\"padding-top: 8px; padding-bottom: 8px; line-height: 26px;\">vector \u662f\u8868\u793a\u53ef\u4ee5\u6539\u53d8\u5927\u5c0f\u7684\u6570\u7ec4\u7684\u5e8f\u5217\u5bb9\u5668\u3002<\/p>\n<table>\n<thead>\n<tr style=\"border-width: 1px 0px 0px; background-color: white; border-color: #cccccc initial initial initial; border-style: solid initial initial initial;\">\n<th style=\"border-top-width: 1px; border-color: #cccccc; background-color: #f0f0f0; text-align: left;\">\u65b9\u6cd5<\/th>\n<th style=\"border-top-width: 1px; border-color: #cccccc; background-color: #f0f0f0; text-align: center;\">\u8bf4\u660e<\/th>\n<\/tr>\n<\/thead>\n<tbody style=\"border: 0px initial initial;\">\n<tr style=\"border-width: 1px 0px 0px; background-color: white; border-color: #cccccc initial initial initial; border-style: solid initial initial initial;\">\n<td style=\"border-color: #cccccc;\">vector<\/td>\n<td style=\"border-color: #cccccc; text-align: center;\">\u6784\u9020\u51fd\u6570<\/td>\n<\/tr>\n<tr style=\"border-width: 1px 0px 0px; background-color: #f8f8f8; border-color: #cccccc initial initial initial; border-style: solid initial initial initial;\">\n<td style=\"border-color: #cccccc;\">~vector<\/td>\n<td style=\"border-color: #cccccc; text-align: center;\">\u6790\u6784\u51fd\u6570\uff0c\u9500\u6bc1\u5bb9\u5668\u5bf9\u8c61<\/td>\n<\/tr>\n<tr style=\"border-width: 1px 0px 0px; background-color: white; border-color: #cccccc initial initial initial; border-style: solid initial initial initial;\">\n<td style=\"border-color: #cccccc;\">operator=<\/td>\n<td style=\"border-color: #cccccc; text-align: center;\">\u5c06\u65b0\u5185\u5bb9\u5206\u914d\u7ed9\u5bb9\u5668\uff0c\u66ff\u6362\u5176\u5f53\u524d\u5185\u5bb9\uff0c\u5e76\u76f8\u5e94\u5730\u4fee\u6539\u5176\u5927\u5c0f<\/td>\n<\/tr>\n<tr style=\"border-width: 1px 0px 0px; background-color: #f8f8f8; border-color: #cccccc initial initial initial; border-style: solid initial initial initial;\">\n<td style=\"border-color: #cccccc;\">begin<\/td>\n<td style=\"border-color: #cccccc; text-align: center;\">\u8fd4\u56de\u6307\u5411\u5bb9\u5668\u4e2d\u7b2c\u4e00\u4e2a\u5143\u7d20\u7684\u8fed\u4ee3\u5668<\/td>\n<\/tr>\n<tr style=\"border-width: 1px 0px 0px; background-color: white; border-color: #cccccc initial initial initial; border-style: solid initial initial initial;\">\n<td style=\"border-color: #cccccc;\">end<\/td>\n<td style=\"border-color: #cccccc; text-align: center;\">\u8fd4\u56de\u6307\u5411\u5bb9\u5668\u4e2d\u6700\u540e\u4e00\u4e2a\u5143\u7d20\u4e4b\u540e\u7684\u7406\u8bba\u5143\u7d20\u7684\u8fed\u4ee3\u5668<\/td>\n<\/tr>\n<tr style=\"border-width: 1px 0px 0px; background-color: #f8f8f8; border-color: #cccccc initial initial initial; border-style: solid initial initial initial;\">\n<td style=\"border-color: #cccccc;\">rbegin<\/td>\n<td style=\"border-color: #cccccc; text-align: center;\">\u8fd4\u56de\u6307\u5411\u5bb9\u5668\u4e2d\u6700\u540e\u4e00\u4e2a\u5143\u7d20\u7684\u53cd\u5411\u8fed\u4ee3\u5668<\/td>\n<\/tr>\n<tr style=\"border-width: 1px 0px 0px; background-color: white; border-color: #cccccc initial initial initial; border-style: solid initial initial initial;\">\n<td style=\"border-color: #cccccc;\">rend<\/td>\n<td style=\"border-color: #cccccc; text-align: center;\">\u8fd4\u56de\u4e00\u4e2a\u53cd\u5411\u8fed\u4ee3\u5668\uff0c\u6307\u5411\u4e2d\u7b2c\u4e00\u4e2a\u5143\u7d20\u4e4b\u524d\u7684\u7406\u8bba\u5143\u7d20<\/td>\n<\/tr>\n<tr style=\"border-width: 1px 0px 0px; background-color: #f8f8f8; border-color: #cccccc initial initial initial; border-style: solid initial initial initial;\">\n<td style=\"border-color: #cccccc;\">cbegin<\/td>\n<td style=\"border-color: #cccccc; text-align: center;\">\u8fd4\u56de\u6307\u5411\u5bb9\u5668\u4e2d\u7b2c\u4e00\u4e2a\u5143\u7d20\u7684\u5e38\u91cf\u8fed\u4ee3\u5668\uff08const_iterator\uff09<\/td>\n<\/tr>\n<tr style=\"border-width: 1px 0px 0px; background-color: white; border-color: #cccccc initial initial initial; border-style: solid initial initial initial;\">\n<td style=\"border-color: #cccccc;\">cend<\/td>\n<td style=\"border-color: #cccccc; text-align: center;\">\u8fd4\u56de\u6307\u5411\u5bb9\u5668\u4e2d\u6700\u540e\u4e00\u4e2a\u5143\u7d20\u4e4b\u540e\u7684\u7406\u8bba\u5143\u7d20\u7684\u5e38\u91cf\u8fed\u4ee3\u5668\uff08const_iterator\uff09<\/td>\n<\/tr>\n<tr style=\"border-width: 1px 0px 0px; background-color: #f8f8f8; border-color: #cccccc initial initial initial; border-style: solid initial initial initial;\">\n<td style=\"border-color: #cccccc;\">crbegin<\/td>\n<td style=\"border-color: #cccccc; text-align: center;\">\u8fd4\u56de\u6307\u5411\u5bb9\u5668\u4e2d\u6700\u540e\u4e00\u4e2a\u5143\u7d20\u7684\u5e38\u91cf\u53cd\u5411\u8fed\u4ee3\u5668\uff08const_reverse_iterator\uff09<\/td>\n<\/tr>\n<tr style=\"border-width: 1px 0px 0px; background-color: white; border-color: #cccccc initial initial initial; border-style: solid initial initial initial;\">\n<td style=\"border-color: #cccccc;\">crend<\/td>\n<td style=\"border-color: #cccccc; text-align: center;\">\u8fd4\u56de\u6307\u5411\u5bb9\u5668\u4e2d\u7b2c\u4e00\u4e2a\u5143\u7d20\u4e4b\u524d\u7684\u7406\u8bba\u5143\u7d20\u7684\u5e38\u91cf\u53cd\u5411\u8fed\u4ee3\u5668\uff08const_reverse_iterator\uff09<\/td>\n<\/tr>\n<tr style=\"border-width: 1px 0px 0px; background-color: #f8f8f8; border-color: #cccccc initial initial initial; border-style: solid initial initial initial;\">\n<td style=\"border-color: #cccccc;\">size<\/td>\n<td style=\"border-color: #cccccc; text-align: center;\">\u8fd4\u56de\u5bb9\u5668\u4e2d\u5143\u7d20\u7684\u6570\u91cf<\/td>\n<\/tr>\n<tr style=\"border-width: 1px 0px 0px; background-color: white; border-color: #cccccc initial initial initial; border-style: solid initial initial initial;\">\n<td style=\"border-color: #cccccc;\">max_size<\/td>\n<td style=\"border-color: #cccccc; text-align: center;\">\u8fd4\u56de\u5bb9\u5668\u53ef\u5bb9\u7eb3\u7684\u6700\u5927\u5143\u7d20\u6570<\/td>\n<\/tr>\n<tr style=\"border-width: 1px 0px 0px; background-color: #f8f8f8; border-color: #cccccc initial initial initial; border-style: solid initial initial initial;\">\n<td style=\"border-color: #cccccc;\">resize<\/td>\n<td style=\"border-color: #cccccc; text-align: center;\">\u8c03\u6574\u5bb9\u5668\u7684\u5927\u5c0f\uff0c\u4f7f\u5176\u5305\u542b n\uff08\u53c2\u6570\uff09\u4e2a\u5143\u7d20<\/td>\n<\/tr>\n<tr style=\"border-width: 1px 0px 0px; background-color: white; border-color: #cccccc initial initial initial; border-style: solid initial initial initial;\">\n<td style=\"border-color: #cccccc;\">capacity<\/td>\n<td style=\"border-color: #cccccc; text-align: center;\">\u8fd4\u56de\u5f53\u524d\u4e3a vector \u5206\u914d\u7684\u5b58\u50a8\u7a7a\u95f4\uff08\u5bb9\u91cf\uff09\u7684\u5927\u5c0f<\/td>\n<\/tr>\n<tr style=\"border-width: 1px 0px 0px; background-color: #f8f8f8; border-color: #cccccc initial initial initial; border-style: solid initial initial initial;\">\n<td style=\"border-color: #cccccc;\">empty<\/td>\n<td style=\"border-color: #cccccc; text-align: center;\">\u8fd4\u56de vector \u662f\u5426\u4e3a\u7a7a<\/td>\n<\/tr>\n<tr style=\"border-width: 1px 0px 0px; background-color: white; border-color: #cccccc initial initial initial; border-style: solid initial initial initial;\">\n<td style=\"border-color: #cccccc;\">reserve<\/td>\n<td style=\"border-color: #cccccc; text-align: center;\">\u8bf7\u6c42 vector \u5bb9\u91cf\u81f3\u5c11\u8db3\u4ee5\u5305\u542b n\uff08\u53c2\u6570\uff09\u4e2a\u5143\u7d20<\/td>\n<\/tr>\n<tr style=\"border-width: 1px 0px 0px; background-color: #f8f8f8; border-color: #cccccc initial initial initial; border-style: solid initial initial initial;\">\n<td style=\"border-color: #cccccc;\">shrink_to_fit<\/td>\n<td style=\"border-color: #cccccc; text-align: center;\">\u8981\u6c42\u5bb9\u5668\u51cf\u5c0f\u5176 capacity\uff08\u5bb9\u91cf\uff09\u4ee5\u9002\u5e94\u5176 size\uff08\u5143\u7d20\u6570\u91cf\uff09<\/td>\n<\/tr>\n<tr style=\"border-width: 1px 0px 0px; background-color: white; border-color: #cccccc initial initial initial; border-style: solid initial initial initial;\">\n<td style=\"border-color: #cccccc;\">operator[]<\/td>\n<td style=\"border-color: #cccccc; text-align: center;\">\u8fd4\u56de\u5bb9\u5668\u4e2d\u7b2c n\uff08\u53c2\u6570\uff09\u4e2a\u4f4d\u7f6e\u7684\u5143\u7d20\u7684\u5f15\u7528<\/td>\n<\/tr>\n<tr style=\"border-width: 1px 0px 0px; background-color: #f8f8f8; border-color: #cccccc initial initial initial; border-style: solid initial initial initial;\">\n<td style=\"border-color: #cccccc;\">at<\/td>\n<td style=\"border-color: #cccccc; text-align: center;\">\u8fd4\u56de\u5bb9\u5668\u4e2d\u7b2c n\uff08\u53c2\u6570\uff09\u4e2a\u4f4d\u7f6e\u7684\u5143\u7d20\u7684\u5f15\u7528<\/td>\n<\/tr>\n<tr style=\"border-width: 1px 0px 0px; background-color: white; border-color: #cccccc initial initial initial; border-style: solid initial initial initial;\">\n<td style=\"border-color: #cccccc;\">front<\/td>\n<td style=\"border-color: #cccccc; text-align: center;\">\u8fd4\u56de\u5bf9\u5bb9\u5668\u4e2d\u7b2c\u4e00\u4e2a\u5143\u7d20\u7684\u5f15\u7528<\/td>\n<\/tr>\n<tr style=\"border-width: 1px 0px 0px; background-color: #f8f8f8; border-color: #cccccc initial initial initial; border-style: solid initial initial initial;\">\n<td style=\"border-color: #cccccc;\">back<\/td>\n<td style=\"border-color: #cccccc; text-align: center;\">\u8fd4\u56de\u5bf9\u5bb9\u5668\u4e2d\u6700\u540e\u4e00\u4e2a\u5143\u7d20\u7684\u5f15\u7528<\/td>\n<\/tr>\n<tr style=\"border-width: 1px 0px 0px; background-color: white; border-color: #cccccc initial initial initial; border-style: solid initial initial initial;\">\n<td style=\"border-color: #cccccc;\">data<\/td>\n<td style=\"border-color: #cccccc; text-align: center;\">\u8fd4\u56de\u6307\u5411\u5bb9\u5668\u4e2d\u7b2c\u4e00\u4e2a\u5143\u7d20\u7684\u6307\u9488<\/td>\n<\/tr>\n<tr style=\"border-width: 1px 0px 0px; background-color: #f8f8f8; border-color: #cccccc initial initial initial; border-style: solid initial initial initial;\">\n<td style=\"border-color: #cccccc;\">assign<\/td>\n<td style=\"border-color: #cccccc; text-align: center;\">\u5c06\u65b0\u5185\u5bb9\u5206\u914d\u7ed9 vector\uff0c\u66ff\u6362\u5176\u5f53\u524d\u5185\u5bb9\uff0c\u5e76\u76f8\u5e94\u5730\u4fee\u6539\u5176 size<\/td>\n<\/tr>\n<tr style=\"border-width: 1px 0px 0px; background-color: white; border-color: #cccccc initial initial initial; border-style: solid initial initial initial;\">\n<td style=\"border-color: #cccccc;\">push_back<\/td>\n<td style=\"border-color: #cccccc; text-align: center;\">\u5728\u5bb9\u5668\u7684\u6700\u540e\u4e00\u4e2a\u5143\u7d20\u4e4b\u540e\u6dfb\u52a0\u4e00\u4e2a\u65b0\u5143\u7d20<\/td>\n<\/tr>\n<tr style=\"border-width: 1px 0px 0px; background-color: #f8f8f8; border-color: #cccccc initial initial initial; border-style: solid initial initial initial;\">\n<td style=\"border-color: #cccccc;\">pop_back<\/td>\n<td style=\"border-color: #cccccc; text-align: center;\">\u5220\u9664\u5bb9\u5668\u4e2d\u7684\u6700\u540e\u4e00\u4e2a\u5143\u7d20\uff0c\u6709\u6548\u5730\u5c06\u5bb9\u5668 size \u51cf\u5c11\u4e00\u4e2a<\/td>\n<\/tr>\n<tr style=\"border-width: 1px 0px 0px; background-color: white; border-color: #cccccc initial initial initial; border-style: solid initial initial initial;\">\n<td style=\"border-color: #cccccc;\">insert<\/td>\n<td style=\"border-color: #cccccc; text-align: center;\">\u901a\u8fc7\u5728\u6307\u5b9a\u4f4d\u7f6e\u7684\u5143\u7d20\u4e4b\u524d\u63d2\u5165\u65b0\u5143\u7d20\u6765\u6269\u5c55\u8be5\u5bb9\u5668\uff0c\u901a\u8fc7\u63d2\u5165\u5143\u7d20\u7684\u6570\u91cf\u6709\u6548\u5730\u589e\u52a0\u5bb9\u5668\u5927\u5c0f<\/td>\n<\/tr>\n<tr style=\"border-width: 1px 0px 0px; background-color: #f8f8f8; border-color: #cccccc initial initial initial; border-style: solid initial initial initial;\">\n<td style=\"border-color: #cccccc;\">erase<\/td>\n<td style=\"border-color: #cccccc; text-align: center;\">\u4ece vector \u4e2d\u5220\u9664\u5355\u4e2a\u5143\u7d20\uff08position\uff09\u6216\u4e00\u7cfb\u5217\u5143\u7d20\uff08[first\uff0clast)\uff09\uff0c\u8fd9\u6709\u6548\u5730\u51cf\u5c11\u4e86\u88ab\u53bb\u9664\u7684\u5143\u7d20\u7684\u6570\u91cf\uff0c\u4ece\u800c\u7834\u574f\u4e86\u5bb9\u5668\u7684\u5927\u5c0f<\/td>\n<\/tr>\n<tr style=\"border-width: 1px 0px 0px; background-color: white; border-color: #cccccc initial initial initial; border-style: solid initial initial initial;\">\n<td style=\"border-color: #cccccc;\">swap<\/td>\n<td style=\"border-color: #cccccc; text-align: center;\">\u901a\u8fc7 x\uff08\u53c2\u6570\uff09\u7684\u5185\u5bb9\u4ea4\u6362\u5bb9\u5668\u7684\u5185\u5bb9\uff0cx \u662f\u53e6\u4e00\u4e2a\u7c7b\u578b\u76f8\u540c\u3001size \u53ef\u80fd\u4e0d\u540c\u7684 vector \u5bf9\u8c61<\/td>\n<\/tr>\n<tr style=\"border-width: 1px 0px 0px; background-color: #f8f8f8; border-color: #cccccc initial initial initial; border-style: solid initial initial initial;\">\n<td style=\"border-color: #cccccc;\">clear<\/td>\n<td style=\"border-color: #cccccc; text-align: center;\">\u4ece vector \u4e2d\u5220\u9664\u6240\u6709\u7684\u5143\u7d20\uff08\u88ab\u9500\u6bc1\uff09\uff0c\u7559\u4e0b size \u4e3a 0 \u7684\u5bb9\u5668<\/td>\n<\/tr>\n<tr style=\"border-width: 1px 0px 0px; background-color: white; border-color: #cccccc initial initial initial; border-style: solid initial initial initial;\">\n<td style=\"border-color: #cccccc;\">emplace<\/td>\n<td style=\"border-color: #cccccc; text-align: center;\">\u901a\u8fc7\u5728 position\uff08\u53c2\u6570\uff09\u4f4d\u7f6e\u5904\u63d2\u5165\u65b0\u5143\u7d20 args\uff08\u53c2\u6570\uff09\u6765\u6269\u5c55\u5bb9\u5668<\/td>\n<\/tr>\n<tr style=\"border-width: 1px 0px 0px; background-color: #f8f8f8; border-color: #cccccc initial initial initial; border-style: solid initial initial initial;\">\n<td style=\"border-color: #cccccc;\">emplace_back<\/td>\n<td style=\"border-color: #cccccc; text-align: center;\">\u5728 vector \u7684\u672b\u5c3e\u63d2\u5165\u4e00\u4e2a\u65b0\u7684\u5143\u7d20\uff0c\u7d27\u8ddf\u5728\u5f53\u524d\u7684\u6700\u540e\u4e00\u4e2a\u5143\u7d20\u4e4b\u540e<\/td>\n<\/tr>\n<tr style=\"border-width: 1px 0px 0px; background-color: white; border-color: #cccccc initial initial initial; border-style: solid initial initial initial;\">\n<td style=\"border-color: #cccccc;\">get_allocator<\/td>\n<td style=\"border-color: #cccccc; text-align: center;\">\u8fd4\u56de\u4e0evector\u5173\u8054\u7684\u6784\u9020\u5668\u5bf9\u8c61\u7684\u526f\u672c<\/td>\n<\/tr>\n<tr style=\"border-width: 1px 0px 0px; background-color: #f8f8f8; border-color: #cccccc initial initial initial; border-style: solid initial initial initial;\">\n<td style=\"border-color: #cccccc;\">swap(vector)<\/td>\n<td style=\"border-color: #cccccc; text-align: center;\">\u5bb9\u5668 x\uff08\u53c2\u6570\uff09\u7684\u5185\u5bb9\u4e0e\u5bb9\u5668 y\uff08\u53c2\u6570\uff09\u7684\u5185\u5bb9\u4ea4\u6362\u3002\u4e24\u4e2a\u5bb9\u5668\u5bf9\u8c61\u90fd\u5fc5\u987b\u662f\u76f8\u540c\u7684\u7c7b\u578b\uff08\u76f8\u540c\u7684\u6a21\u677f\u53c2\u6570\uff09\uff0c\u5c3d\u7ba1\u5927\u5c0f\u53ef\u80fd\u4e0d\u540c<\/td>\n<\/tr>\n<tr style=\"border-width: 1px 0px 0px; background-color: white; border-color: #cccccc initial initial initial; border-style: solid initial initial initial;\">\n<td style=\"border-color: #cccccc;\">relational operators (vector)<\/td>\n<td style=\"border-color: #cccccc; text-align: center;\">\u5f62\u5982 vectorA &gt; vectorB\uff1b\u4f9d\u6b64\u6bd4\u8f83\u6bcf\u4e2a\u5143\u7d20\u7684\u5927\u5c0f\u5173\u7cfb<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<h3 style=\"margin-top: 30px; margin-bottom: 15px; font-weight: bold; font-size: 20px;\">\u6d4b\u8bd5\u4ee3\u7801<\/h3>\n<pre style=\"margin-top: 10px; margin-bottom: 10px; border-radius: 5px; box-shadow: rgba(0, 0, 0, 0.55) 0px 2px 10px;\"><code style=\"overflow-x: auto; padding: 16px; color: #abb2bf; display: -webkit-box; font-family: Operator Mono, Consolas, Monaco, Menlo, monospace; font-size: 12px; -webkit-overflow-scrolling: touch; padding-top: 15px; background: #282c34; border-radius: 5px;\">#include &lt;vector&gt;\n#include &lt;iostream&gt;\nusing namespace std;\n\nint main()\n{\n\n\t\/\/\u6784\u9020\u51fd\u6570,\u590d\u5236\u6784\u9020\u51fd\u6570(\u5143\u7d20\u7c7b\u578b\u8981\u4e00\u81f4),\n\tvector&lt;int&gt; vecA;  \/\/\u521b\u5efa\u4e00\u4e2a\u7a7a\u7684\u7684\u5bb9\u5668\n\tvector&lt;int&gt; vecB(10,20); \/\/\u521b\u5efa\u4e00\u4e2a10\u4e2a\u5143\u7d20,\u6bcf\u4e2a\u5143\u7d20\u503c\u4e3a20\n\tvector&lt;int&gt; vecC(vecB.begin(),vecB.end()); \/\/\u4f7f\u7528\u8fed\u4ee3\u5668,\u53ef\u4ee5\u53d6\u90e8\u5206\u5143\u7d20\u521b\u5efa\u4e00\u4e2a\u65b0\u7684\u5bb9\u5668\n\tvector&lt;int&gt; vecD(vecC); \/\/\u590d\u5236\u6784\u9020\u51fd\u6570,\u521b\u5efa\u4e00\u4e2a\u5b8c\u5168\u4e00\u6837\u7684\u5bb9\u5668\n\n\t\/\/\u91cd\u8f7d=\n\tvector&lt;int&gt; vecE;\n\tvecE = vecB;\n\n\t\/\/vector::begin()\uff0c\u8fd4\u56de\u7684\u662f\u8fed\u4ee3\u5668\n\n\tvector&lt;int&gt; vecF(10); \/\/\u521b\u5efa\u4e00\u4e2a\u670910\u4e2a\u5143\u7d20\u7684\u5bb9\u5668\n\tcout &lt;&lt; \"vecF:\";\n\tfor (int i = 0; i &lt; 10; i++)\n\t{\n\t\tvecF[i] = i;\n\t\tcout &lt;&lt; vecF[i]&lt;&lt; \" \";\n\t}\n\tcout &lt;&lt; endl;\n\n\t\/\/vector::begin() \u8fd4\u56de\u8fed\u4ee3\u5668\n\tvector&lt;int&gt;::iterator Beginit = vecF.begin();\n\tcout&lt;&lt; \"vecF.begin():\" &lt;&lt; *Beginit &lt;&lt; endl; \n\n\t\/\/vector::end() \u8fd4\u56de\u8fed\u4ee3\u5668\n\tvector&lt;int&gt;::iterator EndIter = vecF.end();\n\tEndIter--; \/\/\u5411\u540e\u79fb\u4e00\u4e2a\u4f4d\u7f6e\n\tcout &lt;&lt;\"vecF.end():\"&lt;&lt; *EndIter &lt;&lt; endl; \n\n\t\/\/vector::rbegin() \u8fd4\u56de\u5012\u5e8f\u7684\u7b2c\u4e00\u4e2a\u5143\u7d20\uff0c\u76f8\u5f53\u4e8e\u6700\u540e\u4e00\u4e2a\u5143\u7d20\n\tvector&lt;int&gt;::reverse_iterator ReverBeIter = vecF.rbegin();\n\tcout &lt;&lt; \"vecF.rbegin(): \"&lt;&lt; *ReverBeIter &lt;&lt; endl; \n\n\t\/\/vector::rend() \u53cd\u5e8f\u7684\u6700\u540e\u4e00\u4e2a\u5143\u7d20\u4e0b\u4e00\u4e2a\u4f4d\u7f6e\uff0c\u4e5f\u76f8\u5f53\u4e8e\u6b63\u5e8f\u7684\u7b2c\u4e00\u4e2a\u5143\u7d20\u524d\u4e00\u4e2a\u4f4d\u7f6e\n\tvector&lt;int&gt;::reverse_iterator ReverEnIter = vecF.rend();\n\tReverEnIter--;\n\tcout &lt;&lt; \"vecF.rend():\"&lt;&lt; *ReverEnIter &lt;&lt; endl; \n\n\t\/\/vector::size() \u8fd4\u56de\u5143\u7d20\u7684\u4e2a\u6570\n\tcout &lt;&lt; \"vecF.size():\"&lt;&lt; vecF.size() &lt;&lt; endl; \n\n\t\/\/vector::max_size()\n\tcout &lt;&lt; \"vecF.max_size():\"&lt;&lt; vecF.max_size() &lt;&lt; endl; \n\n\t\/\/vector::resize()\n\tcout&lt;&lt; \"vecF.size():\" &lt;&lt; vecF.size() &lt;&lt; endl; \n\tvecF.resize(5);\n\n\tcout&lt;&lt; \"\u8c03\u6574vecF\u5927\u5c0f\u540e\u91cd\u65b0\u8d4b\u503c:\"; \n\tfor(int k = 0; k &lt; vecF.size(); k++)\n\t\tcout &lt;&lt; vecF[k] &lt;&lt; \"  \"; \n\tcout &lt;&lt; endl;\n\n\t\/\/vector::capacity()\n\tcout&lt;&lt; \"\u8c03\u6574\u540evecF.size():\"&lt;&lt; vecF.size() &lt;&lt; endl; \n\tcout&lt;&lt; \"\u8c03\u6574\u540evecF.capacity():\" &lt;&lt; vecF.capacity() &lt;&lt; endl; \n\n\t\/\/vector::empty()\n\tvecB.resize(0);\n\tcout&lt;&lt; \"vecB.resize(0)\u540e\"&lt;&lt; endl; \n\n\tcout  &lt;&lt; \"vecB.size():\" &lt;&lt; vecB.size() &lt;&lt; endl; \n\tcout  &lt;&lt; \"vecB.capacity():\" &lt;&lt; vecB.capacity() &lt;&lt; endl; \n\tif(vecB.empty())\n\t    cout &lt;&lt; \"vecB\u4e3a\u7a7a\"&lt;&lt; endl; \n\telse\n\t\tcout &lt;&lt; \"vecB\u4e0d\u4e3a\u7a7a\"&lt;&lt; endl; \n\n\t\/\/vector::reserve() \/\/\u91cd\u65b0\u5206\u914d\u5b58\u50a8\u7a7a\u95f4\u5927\u5c0f\n\tcout&lt;&lt; \"vecC.capacity():\" &lt;&lt; vecC.capacity() &lt;&lt; endl; \/\/\n\n\tvecC.reserve(4);\n\tcout &lt;&lt; \"vecC.reserve(4)\u540evecC.capacity()\uff1a \"&lt;&lt; vecC.capacity() &lt;&lt; endl; \/\/10\n\tvecC.reserve(14);\n\tcout &lt;&lt; \"vecC.reserve(14)\u540evecC.capacity()\uff1a \"&lt;&lt; vecC.capacity() &lt;&lt; endl; \/\/14\n\n\t\/\/vector::operator []\n\tcout &lt;&lt; \"vecF[0]:\"&lt;&lt; vecF[0] &lt;&lt; endl; \/\/\u7b2c\u4e00\u4e2a\u5143\u7d20\u662f0\n\n\t\/\/vector::at()\n\ttry\n\t{\n\t\tcout &lt;&lt; \"vecF.size = \" &lt;&lt; vecF.size() &lt;&lt; endl; \/\/5\n\t\tcout &lt;&lt; vecF.at(6) &lt;&lt; endl; \/\/\u629b\u51fa\u5f02\u5e38\n\t}\n\tcatch(out_of_range)\n\t{\t\n\t\tcout &lt;&lt; \"at()\u8bbf\u95ee\u8d8a\u754c\" &lt;&lt; endl;\n\t}\n\n\t\/\/vector::front() \u8fd4\u56de\u7b2c\u4e00\u4e2a\u5143\u7d20\u7684\u503c\n\tcout &lt;&lt; \"vecF.front():\"&lt;&lt; vecF.front() &lt;&lt; endl; \/\/0\n\n\t\/\/vector::back()\n\tcout &lt;&lt; \"vecF.back():\"&lt;&lt; vecF.back() &lt;&lt; endl; \/\/4\n\n\t\/\/vector::assign()\n\tcout &lt;&lt;\"vecA.size():\"&lt;&lt; vecA.size() &lt;&lt; endl; \/\/0\n\tvector&lt;int&gt;::iterator First = vecC.begin();\n\tvector&lt;int&gt;::iterator End = vecC.end()-2;\n\tvecA.assign(First,End);\n\tcout &lt;&lt; vecA.size() &lt;&lt; endl; \/\/8\n\tcout &lt;&lt; vecA.capacity() &lt;&lt; endl; \/\/8\n\n\tvecA.assign(5,3); \/\/\u5c06\u4e22\u5f03\u539f\u6765\u7684\u6240\u6709\u5143\u7d20\u7136\u540e\u91cd\u65b0\u8d4b\u503c\n\tcout &lt;&lt; vecA.size() &lt;&lt; endl; \/\/5\n\tcout &lt;&lt; vecA.capacity() &lt;&lt; endl; \/\/8\n\n\t\/\/vector::push_back()\n\tcout &lt;&lt; *(vecF.end()-1) &lt;&lt; endl; \/\/4\n\tvecF.push_back(20);\n\tcout &lt;&lt; *(vecF.end()-1) &lt;&lt; endl; \/\/20\n\n\t\/\/vector::pop_back()\n\tcout &lt;&lt; *(vecF.end()-1) &lt;&lt; endl; \/\/20\n\tvecF.pop_back();\n\tcout &lt;&lt; *(vecF.end()-1) &lt;&lt; endl; \/\/4\n\n\t\/\/vector::swap()\n\tcout &lt;&lt; \"vecF:\";\n\tfor (int i = 0; i &lt; vecF.size(); i++)\n\t{\n\t\tvecF[i] = i;\n\t\tcout &lt;&lt; vecF[i]&lt;&lt; \" \";\n\t}\n\tcout &lt;&lt; endl;\n\tcout &lt;&lt; \"vecD:\";\n\tfor (int d = 0; d &lt; vecD.size(); d++)\n\t{\n\t\tvecD[d] = d;\n\t\tcout &lt;&lt; vecD[d]&lt;&lt; \" \";\n\t}\n\tcout &lt;&lt; endl;\n\n\tvecF.swap(vecD); \/\/\u4ea4\u6362\u8fd9\u4e24\u4e2a\u5bb9\u5668\u7684\u5185\u5bb9\n\tcout &lt;&lt;\"vecD\u4e0evecF\u4ea4\u6362\u540e\uff1a\" &lt;&lt;endl;\n\tcout &lt;&lt; \"vecF:\";\n\tfor(int f = 0; f &lt; vecF.size(); f++)\n\t\tcout &lt;&lt; vecF[f] &lt;&lt; \" \";\n\tcout &lt;&lt; endl;\n\n\tcout &lt;&lt; \"vecD:\";\n\tfor (int d = 0; d &lt;vecD.size(); d++)\n\t\tcout &lt;&lt; vecD[d] &lt;&lt; \" \";\n\tcout &lt;&lt; endl;\n\t\/\/vector::clear()\n\tvecF.clear();\n\tcout &lt;&lt; \"vecF.clear()\u540evecF.size()\uff1a\"&lt;&lt; vecF.size() &lt;&lt; endl;     \/\/0\n\tcout &lt;&lt; \"vecF.clear()\u540evecF.capacity()\uff1a\"&lt;&lt; vecF.capacity() &lt;&lt; endl; \/\/10\n\n\treturn 0;\n}\n<\/code><\/pre>\n<h3 style=\"margin-top: 30px; margin-bottom: 15px; font-weight: bold; font-size: 20px;\">\u8fd0\u884c\u7ed3\u679c<\/h3>\n<figure style=\"margin-top: 10px; margin-bottom: 10px;\"><img decoding=\"async\" style=\"display: block; margin-right: auto; margin-left: auto;\" title=\"STL\u603b\u7ed3\u4e0e\u5e38\u89c1\u9762\u8bd5\u9898\" src=\"http:\/\/www.zhushiyao.com\/wp-content\/uploads\/2022\/04\/1-1649301272.png\" alt=\"STL\u603b\u7ed3\u4e0e\u5e38\u89c1\u9762\u8bd5\u9898\" \/><figcaption style=\"margin-top: 5px; text-align: center; color: #888; font-size: 14px;\">\u8fd0\u884c\u7ed3\u679c<\/figcaption><\/figure>\n<h3 style=\"margin-top: 30px; margin-bottom: 15px; font-weight: bold; font-size: 20px;\">deque<\/h3>\n<p style=\"padding-top: 8px; padding-bottom: 8px; line-height: 26px;\">deque\u5bb9\u5668\u4e3a\u4e00\u4e2a\u7ed9\u5b9a\u7c7b\u578b\u7684\u5143\u7d20\u8fdb\u884c\u7ebf\u6027\u5904\u7406\uff0c\u50cf\u5411\u91cf\u4e00\u6837\uff0c\u5b83\u80fd\u591f\u5feb\u901f\u5730\u968f\u673a\u8bbf\u95ee\u4efb\u4e00\u4e2a\u5143\u7d20\uff0c\u5e76\u4e14\u80fd\u591f\u9ad8\u6548\u5730\u63d2\u5165\u548c\u5220\u9664\u5bb9\u5668\u7684\u5c3e\u90e8\u5143\u7d20\u3002\u4f46\u5b83\u53c8\u4e0evector\u4e0d\u540c\uff0c<strong>deque\u652f\u6301\u9ad8\u6548\u63d2\u5165\u548c\u5220\u9664\u5bb9\u5668\u7684\u5934\u90e8\u5143\u7d20<\/strong>\uff0c\u56e0\u6b64\u4e5f\u53eb\u505a\u53cc\u7aef\u961f\u5217\u3002<\/p>\n<figure style=\"margin-top: 10px; margin-bottom: 10px;\"><img decoding=\"async\" style=\"display: block; margin-right: auto; margin-left: auto;\" title=\"STL\u603b\u7ed3\u4e0e\u5e38\u89c1\u9762\u8bd5\u9898\" src=\"http:\/\/www.zhushiyao.com\/wp-content\/uploads\/2022\/04\/9-1649301272.jpeg\" alt=\"STL\u603b\u7ed3\u4e0e\u5e38\u89c1\u9762\u8bd5\u9898\" \/><\/figure>\n<p style=\"padding-top: 8px; padding-bottom: 8px; line-height: 26px;\"><strong>deque\u7684\u4e2d\u63a7\u5668<\/strong>: deque\u662f\u7531\u4e00\u6bb5\u4e00\u6bb5\u7684\u5b9a\u91cf\u8fde\u7eed\u7a7a\u95f4\u6784\u6210\u3002\u4e00\u65e6\u6709\u5fc5\u8981\u5728deque\u7684\u524d\u7aef\u6216\u5c3e\u7aef\u589e\u52a0\u65b0\u7a7a\u95f4\uff0c\u4fbf\u914d\u7f6e\u4e00\u6bb5\u5b9a\u91cf\u8fde\u7eed\u7a7a\u95f4\uff0c\u4e32\u63a5\u5728\u6574\u4e2adeque\u7684\u5934\u7aef\u6216\u5c3e\u7aef\u3002deque\u7684\u6700\u5927\u4efb\u52a1\uff0c\u4fbf\u662f\u5728\u8fd9\u4e9b\u5206\u6bb5\u7684\u5b9a\u91cf\u8fde\u7eed\u7a7a\u95f4\u4e0a\uff0c\u7ef4\u62a4\u5176\u6574\u4f53\u8fde\u7eed\u7684\u5047\u8c61\uff0c\u5e76\u63d0\u4f9b\u968f\u673a\u5b58\u53d6\u7684\u63a5\u53e3\u3002\u907f\u5f00\u4e86\u201c\u91cd\u65b0\u914d\u7f6e\u3001\u590d\u5236\u3001\u91ca\u653e\u201d\u7684\u8f6e\u56de\uff0c\u4ee3\u4ef7\u5219\u662f\u590d\u6742\u7684\u8fed\u4ee3\u5668\u7ed3\u6784\u3002<\/p>\n<figure style=\"margin-top: 10px; margin-bottom: 10px;\"><img decoding=\"async\" style=\"display: block; margin-right: auto; margin-left: auto;\" title=\"STL\u603b\u7ed3\u4e0e\u5e38\u89c1\u9762\u8bd5\u9898\" src=\"http:\/\/www.zhushiyao.com\/wp-content\/uploads\/2022\/04\/3-1649301272.jpeg\" alt=\"STL\u603b\u7ed3\u4e0e\u5e38\u89c1\u9762\u8bd5\u9898\" \/><\/figure>\n<p style=\"padding-top: 8px; padding-bottom: 8px; line-height: 26px;\">deque\u91c7\u7528\u4e00\u5757\u6240\u8c13\u7684map\uff08\u4e0d\u662fSTL\u7684map\u5bb9\u5668\uff09\u4f5c\u4e3a\u4e3b\u63a7\u3002<\/p>\n<p style=\"padding-top: 8px; padding-bottom: 8px; line-height: 26px;\">map\u662f\u4e00\u5c0f\u5757\u8fde\u7eed\u7a7a\u95f4\uff0c\u5176\u4e2d\u6bcf\u4e2a\u5143\u7d20(\u6b64\u5904\u79f0\u4e3a\u4e00\u4e2a\u8282\u70b9\uff0cnode)\u90fd\u662f\u6307\u9488\uff0c\u6307\u5411\u53e6\u4e00\u6bb5(\u8f83\u5927\u7684)\u8fde\u7eed\u7ebf\u6027\u7a7a\u95f4\uff0c\u79f0\u4e3a\u7f13\u51b2\u533a\u3002<\/p>\n<p style=\"padding-top: 8px; padding-bottom: 8px; line-height: 26px;\">\u7f13\u51b2\u533a\u624d\u662fdeque\u7684\u50a8\u5b58\u7a7a\u95f4\u4e3b\u4f53\u3002<\/p>\n<pre style=\"margin-top: 10px; margin-bottom: 10px; border-radius: 5px; box-shadow: rgba(0, 0, 0, 0.55) 0px 2px 10px;\"><code style=\"overflow-x: auto; padding: 16px; color: #abb2bf; display: -webkit-box; font-family: Operator Mono, Consolas, Monaco, Menlo, monospace; font-size: 12px; -webkit-overflow-scrolling: touch; padding-top: 15px; background: #282c34; border-radius: 5px;\">template&lt;class T, class Alloc = alloc, size_t BufSiz = 0&gt;  \nclass deque{  \npublic :  \n    typedef T value_type ;  \n    typedef value_type* pointer ;  \n    ...  \nprotected :  \n    \/\/\u5143\u7d20\u7684\u6307\u9488\u7684\u6307\u9488(pointer of pointer of T)  \n    \/\/ \u5176\u5b9e\u5c31\u662fT**\uff0c\u4e00\u4e2a\u4e8c\u7ea7\u6307\u9488\uff0c\u7ef4\u62a4\u4e00\u4e2a\u4e8c\u7ef4\u6570\u7ec4\n    typedef pointer* map_pointer ; \n  \nprotected :  \n    map_pointer map ; \/\/\u6307\u5411map,map\u662f\u5757\u8fde\u7eed\u7a7a\u95f4\uff0c\u5176\u5185\u7684\u6bcf\u4e2a\u5143\u7d20  \n                      \/\/\u90fd\u662f\u4e00\u4e2a\u6307\u9488(\u79f0\u4e3a\u8282\u70b9)\uff0c\u6307\u5411\u4e00\u5757\u7f13\u51b2\u533a  \n    size_type map_size ;\/\/map\u5185\u53ef\u5bb9\u7eb3\u591a\u5c11\u6307\u9488  \n    ...  \n};  \n<\/code><\/pre>\n<p style=\"padding-top: 8px; padding-bottom: 8px; line-height: 26px;\">map\u5176\u5b9e\u662f\u4e00\u4e2aT**\uff0c\u4e5f\u5c31\u662f\u8bf4\u5b83\u662f\u4e00\u4e2a\u6307\u9488\uff0c\u6240\u6307\u4e4b\u7269\u4e5f\u662f\u4e00\u4e2a\u6307\u9488\uff0c\u6307\u5411\u578b\u522b\u4e3aT\u7684\u4e00\u5757\u7a7a\u95f4\u3002<\/p>\n<table>\n<thead>\n<tr style=\"border-width: 1px 0px 0px; background-color: white; border-color: #cccccc initial initial initial; border-style: solid initial initial initial;\">\n<th style=\"border-top-width: 1px; border-color: #cccccc; background-color: #f0f0f0; text-align: left;\">\u65b9\u6cd5<\/th>\n<th style=\"border-top-width: 1px; border-color: #cccccc; background-color: #f0f0f0; text-align: center;\">\u8bf4\u660e<\/th>\n<\/tr>\n<\/thead>\n<tbody style=\"border: 0px initial initial;\">\n<tr style=\"border-width: 1px 0px 0px; background-color: white; border-color: #cccccc initial initial initial; border-style: solid initial initial initial;\">\n<td style=\"border-color: #cccccc;\">deque<\/td>\n<td style=\"border-color: #cccccc; text-align: center;\">\u6784\u9020\u51fd\u6570<\/td>\n<\/tr>\n<tr style=\"border-width: 1px 0px 0px; background-color: #f8f8f8; border-color: #cccccc initial initial initial; border-style: solid initial initial initial;\">\n<td style=\"border-color: #cccccc;\">push_back<\/td>\n<td style=\"border-color: #cccccc; text-align: center;\">\u5728\u5f53\u524d\u7684\u6700\u540e\u4e00\u4e2a\u5143\u7d20\u4e4b\u540e \uff0c\u5728 deque \u5bb9\u5668\u7684\u672b\u5c3e\u6dfb\u52a0\u4e00\u4e2a\u65b0\u5143\u7d20<\/td>\n<\/tr>\n<tr style=\"border-width: 1px 0px 0px; background-color: white; border-color: #cccccc initial initial initial; border-style: solid initial initial initial;\">\n<td style=\"border-color: #cccccc;\">push_front<\/td>\n<td style=\"border-color: #cccccc; text-align: center;\">\u5728 deque \u5bb9\u5668\u7684\u5f00\u59cb\u4f4d\u7f6e\u63d2\u5165\u4e00\u4e2a\u65b0\u7684\u5143\u7d20\uff0c\u4f4d\u4e8e\u5f53\u524d\u7684\u7b2c\u4e00\u4e2a\u5143\u7d20\u4e4b\u524d<\/td>\n<\/tr>\n<tr style=\"border-width: 1px 0px 0px; background-color: #f8f8f8; border-color: #cccccc initial initial initial; border-style: solid initial initial initial;\">\n<td style=\"border-color: #cccccc;\">pop_back<\/td>\n<td style=\"border-color: #cccccc; text-align: center;\">\u5220\u9664 deque \u5bb9\u5668\u4e2d\u7684\u6700\u540e\u4e00\u4e2a\u5143\u7d20\uff0c\u6709\u6548\u5730\u5c06\u5bb9\u5668\u5927\u5c0f\u51cf\u5c11\u4e00\u4e2a<\/td>\n<\/tr>\n<tr style=\"border-width: 1px 0px 0px; background-color: white; border-color: #cccccc initial initial initial; border-style: solid initial initial initial;\">\n<td style=\"border-color: #cccccc;\">pop_front<\/td>\n<td style=\"border-color: #cccccc; text-align: center;\">\u5220\u9664 deque \u5bb9\u5668\u4e2d\u7684\u7b2c\u4e00\u4e2a\u5143\u7d20\uff0c\u6709\u6548\u5730\u51cf\u5c0f\u5176\u5927\u5c0f<\/td>\n<\/tr>\n<tr style=\"border-width: 1px 0px 0px; background-color: #f8f8f8; border-color: #cccccc initial initial initial; border-style: solid initial initial initial;\">\n<td style=\"border-color: #cccccc;\">emplace_front<\/td>\n<td style=\"border-color: #cccccc; text-align: center;\">\u5728 deque \u7684\u5f00\u5934\u63d2\u5165\u4e00\u4e2a\u65b0\u7684\u5143\u7d20\uff0c\u5c31\u5728\u5176\u5f53\u524d\u7684\u7b2c\u4e00\u4e2a\u5143\u7d20\u4e4b\u524d<\/td>\n<\/tr>\n<tr style=\"border-width: 1px 0px 0px; background-color: white; border-color: #cccccc initial initial initial; border-style: solid initial initial initial;\">\n<td style=\"border-color: #cccccc;\">emplace_back<\/td>\n<td style=\"border-color: #cccccc; text-align: center;\">\u5728 deque \u7684\u672b\u5c3e\u63d2\u5165\u4e00\u4e2a\u65b0\u7684\u5143\u7d20\uff0c\u7d27\u8ddf\u5728\u5f53\u524d\u7684\u6700\u540e\u4e00\u4e2a\u5143\u7d20\u4e4b\u540e<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<h3 style=\"margin-top: 30px; margin-bottom: 15px; font-weight: bold; font-size: 20px;\">\u6d4b\u8bd5\u4ee3\u7801<\/h3>\n<pre style=\"margin-top: 10px; margin-bottom: 10px; border-radius: 5px; box-shadow: rgba(0, 0, 0, 0.55) 0px 2px 10px;\"><code style=\"overflow-x: auto; padding: 16px; color: #abb2bf; display: -webkit-box; font-family: Operator Mono, Consolas, Monaco, Menlo, monospace; font-size: 12px; -webkit-overflow-scrolling: touch; padding-top: 15px; background: #282c34; border-radius: 5px;\">#include \"stdafx.h\"\n#include&lt;iostream&gt;\n#include&lt;deque&gt;\n \nusing namespace std;\nint main()\n{\n\tdeque&lt;int&gt; d;\n\td.push_back( 11 );\/\/\u5728 deque \u5bb9\u5668\u7684\u672b\u5c3e\u6dfb\u52a0\u4e00\u4e2a\u65b0\u5143\u7d20\n\td.push_back(20);\n\td.push_back(35);\n\tcout&lt;&lt;\"\u521d\u59cb\u5316\u53cc\u7aef\u961f\u5217d\uff1a\"&lt;&lt;endl;\n\tfor(int i = 0; i &lt; d.size(); i++)\n\t{\n\t\tcout&lt;&lt;d.at(i)&lt;&lt;\"t\";\n\t}\n\tcout&lt;&lt;endl;\n\n\td.push_front(10);\/\/\u5bb9\u5668\u7684\u5f00\u59cb\u4f4d\u7f6e\u63d2\u5165\u4e00\u4e2a\u65b0\u7684\u5143\u7d20\uff0c\u4f4d\u4e8e\u5f53\u524d\u7684\u7b2c\u4e00\u4e2a\u5143\u7d20\u4e4b\u524d\n\td.push_front(7);\n\td.push_front(1);\n \n\tcout&lt;&lt;\"\u961f\u5217d\u5411\u524d\u9646\u7eed\u63d2\u516510\u30017\u30011:\"&lt;&lt;endl;\n\tfor(int i = 0;i &lt; d.size();i++)\n\t{\n\t\tcout&lt;&lt;d.at(i)&lt;&lt;\"t\";\n\t}\n\tcout&lt;&lt;endl;\n\n\td.pop_back(); \/\/\u5220\u9664 deque \u5bb9\u5668\u4e2d\u7684\u6700\u540e\u4e00\u4e2a\u5143\u7d20\uff0c\u6709\u6548\u5730\u5c06\u5bb9\u5668\u5927\u5c0f\u51cf\u5c11\u4e00\u4e2a\n\td.pop_front(); \/\/\u5220\u9664 deque \u5bb9\u5668\u4e2d\u7684\u7b2c\u4e00\u4e2a\u5143\u7d20\uff0c\u6709\u6548\u5730\u51cf\u5c0f\u5176\u5927\u5c0f\n\tcout&lt;&lt;\"\u5220\u9664deque\u6700\u540e\u4e00\u4e2a\u548c\u7b2c\u4e00\u4e2a\u5143\u7d20\u540e:\"&lt;&lt;endl;\n\tfor(int i = 0;i &lt; d.size();i++)\n\t{\n\t\tcout&lt;&lt;d.at(i)&lt;&lt;\"t\";\n\t}\n\tcout&lt;&lt;endl;\n\treturn 0;\n}\n<\/code><\/pre>\n<h3 style=\"margin-top: 30px; margin-bottom: 15px; font-weight: bold; font-size: 20px;\">forward_list<\/h3>\n<p style=\"padding-top: 8px; padding-bottom: 8px; line-height: 26px;\">\u5728\u5934\u6587\u4ef6&lt;forward_list&gt;\u4e2d\uff0c\u4e0elist\u7c7b\u4f3c\uff0c\u533a\u522b\u5c31\u662flist\u65f6\u53cc\u94fe\u8868\uff0cforward_list\u662f\u5355\u94fe\u8868\uff0cforward_list\uff08\u5355\u5411\u94fe\u8868\uff09\u662f\u5e8f\u5217\u5bb9\u5668\uff0c\u5141\u8bb8\u5728\u5e8f\u5217\u4e2d\u7684\u4efb\u4f55\u5730\u65b9\u8fdb\u884c\u6052\u5b9a\u7684\u65f6\u95f4\u63d2\u5165\u548c\u64e6\u9664\u64cd\u4f5c\u3002\u5728\u94fe\u8868\u7684\u4efb\u4f55\u4f4d\u7f6e\u8fdb\u884c\u63d2\u5165\/\u5220\u9664\u64cd\u4f5c\u90fd\u975e\u5e38\u5feb\u3002<\/p>\n<figure style=\"margin-top: 10px; margin-bottom: 10px;\"><img decoding=\"async\" style=\"display: block; margin-right: auto; margin-left: auto;\" title=\"STL\u603b\u7ed3\u4e0e\u5e38\u89c1\u9762\u8bd5\u9898\" src=\"http:\/\/www.zhushiyao.com\/wp-content\/uploads\/2022\/04\/8-1649301272.png\" alt=\"STL\u603b\u7ed3\u4e0e\u5e38\u89c1\u9762\u8bd5\u9898\" \/><\/figure>\n<p style=\"padding-top: 8px; padding-bottom: 8px; line-height: 26px;\"><strong>forward_list\u7684\u7279\u70b9<\/strong>\uff1a<\/p>\n<ul class=\"list-paddingleft-1\" style=\"margin-top: 8px; margin-bottom: 8px; padding-left: 25px;\">\n<li>\n<section style=\"margin-top: 5px; margin-bottom: 5px; line-height: 26px; color: #010101;\">forward_list\u53ea\u63d0\u4f9b\u94b1\u7bb1\u8fed\u4ee3\u5668\uff0c\u56e0\u6b64\u4e0d\u652f\u6301\u53cd\u5411\u8fed\u4ee3\u5668\uff0c\u6bd4\u5982rbegin()\u7b49\u6210\u5458\u51fd\u6570\u3002<\/section>\n<\/li>\n<li>\n<section style=\"margin-top: 5px; margin-bottom: 5px; line-height: 26px; color: #010101;\">forward_list\u4e0d\u63d0\u4f9bsize\uff08\uff09\u6210\u5458\u51fd\u6570\u3002<\/section>\n<\/li>\n<li>\n<section style=\"margin-top: 5px; margin-bottom: 5px; line-height: 26px; color: #010101;\">forward_list\u6ca1\u6709\u6307\u5411\u6700\u672b\u5143\u7d20\u7684\u951a\u70b9\uff0c\u56e0\u6b64\u4e0d\u63d0\u4f9bback\uff08\uff09\u3001push_back\uff08\uff09\u548cpop_back\uff08\uff09\u3002<\/section>\n<\/li>\n<li>\n<section style=\"margin-top: 5px; margin-bottom: 5px; line-height: 26px; color: #010101;\">forward_list\u4e0d\u63d0\u4f9b\u968f\u673a\u8bbf\u95ee\uff0c\u8fd9\u4e00\u70b9\u8ddflist\u76f8\u540c\u3002<\/section>\n<\/li>\n<li>\n<section style=\"margin-top: 5px; margin-bottom: 5px; line-height: 26px; color: #010101;\">\u63d2\u5165\u548c\u5220\u9664\u5143\u7d20\u4e0d\u4f1a\u9020\u6210\u201c\u6307\u5411\u81f3\u5176\u4ed6\u5143\u7d20\u201d\u7684\u6307\u9488\uff0c\u5f15\u7528\u548c\u8fed\u4ee3\u5668\u5931\u6548\u3002<\/section>\n<\/li>\n<\/ul>\n<blockquote style=\"font-size: 0.9em; overflow: auto; color: #6a737d; padding: 10px 10px 10px 20px; margin-bottom: 20px; margin-top: 20px; border-left-color: #ef7060; background: #fff9f9;\">\n<p style=\"font-size: 16px; padding-top: 8px; padding-bottom: 8px; color: black; line-height: 26px;\">\u5bb9\u5668\u6210\u5458\u51fd\u6570\u603b\u7ed3\u5c31\u4e0d\u5199\u4e86,\u592a\u591a\u5f71\u54cd\u9605\u8bfb,\u611f\u5174\u8da3\u5c0f\u4f19\u4f34\u6233http:\/\/www.cplusplus.com\/reference\/stl\/<\/p>\n<\/blockquote>\n<h3 style=\"margin-top: 30px; margin-bottom: 15px; font-weight: bold; font-size: 20px;\">list<\/h3>\n<figure style=\"margin-top: 10px; margin-bottom: 10px;\"><img decoding=\"async\" style=\"display: block; margin-right: auto; margin-left: auto;\" title=\"STL\u603b\u7ed3\u4e0e\u5e38\u89c1\u9762\u8bd5\u9898\" src=\"http:\/\/www.zhushiyao.com\/wp-content\/uploads\/2022\/04\/9-1649301272-1.jpeg\" alt=\"STL\u603b\u7ed3\u4e0e\u5e38\u89c1\u9762\u8bd5\u9898\" \/><\/figure>\n<p style=\"padding-top: 8px; padding-bottom: 8px; line-height: 26px;\">list\u53cc\u5411\u94fe\u8868\uff0c\u662f\u5e8f\u5217\u5bb9\u5668\uff0c\u5141\u8bb8\u5728\u5e8f\u5217\u4e2d\u7684\u4efb\u4f55\u5730\u65b9\u8fdb\u884c\u5e38\u6570\u65f6\u95f4\u63d2\u5165\u548c\u64e6\u9664\u64cd\u4f5c\uff0c\u5e76\u5728\u4e24\u4e2a\u65b9\u5411\u4e0a\u8fdb\u884c\u8fed\u4ee3,\u53ef\u4ee5\u9ad8\u6548\u5730\u8fdb\u884c\u63d2\u5165\u5220\u9664\u5143\u7d20\u3002<\/p>\n<p style=\"padding-top: 8px; padding-bottom: 8px; line-height: 26px;\">\u4f7f\u7528list\u5bb9\u5668\u4e4b\u524d\u5fc5\u987b\u52a0\u4e0a\u5934\u6587\u4ef6\uff1a#include;<\/p>\n<p style=\"padding-top: 8px; padding-bottom: 8px; line-height: 26px;\"><strong>list\u5bb9\u5668\u7684\u5e95\u5c42\u5b9e\u73b0<\/strong>:<\/p>\n<p style=\"padding-top: 8px; padding-bottom: 8px; line-height: 26px;\">\u548c array\u3001vector \u8fd9\u4e9b\u5bb9\u5668\u8fed\u4ee3\u5668\u7684\u5b9e\u73b0\u65b9\u5f0f\u4e0d\u540c\uff0c\u7531\u4e8e list \u5bb9\u5668\u7684\u5143\u7d20\u5e76\u4e0d\u662f\u8fde\u7eed\u5b58\u50a8\u7684\uff0c\u6240\u4ee5\u8be5\u5bb9\u5668\u8fed\u4ee3\u5668\u4e2d\uff0c\u5fc5\u987b\u5305\u542b\u4e00\u4e2a\u53ef\u4ee5\u6307\u5411 list \u5bb9\u5668\u7684\u6307\u9488\uff0c\u5e76\u4e14\u8be5\u6307\u9488\u8fd8\u53ef\u4ee5\u501f\u52a9\u91cd\u8f7d\u7684 *\u3001++\u3001&#8211;\u3001==\u3001!= \u7b49\u8fd0\u7b97\u7b26\uff0c\u5b9e\u73b0\u8fed\u4ee3\u5668\u6b63\u786e\u7684\u9012\u589e\u3001\u9012\u51cf\u3001\u53d6\u503c\u7b49\u64cd\u4f5c\u3002<\/p>\n<pre style=\"margin-top: 10px; margin-bottom: 10px; border-radius: 5px; box-shadow: rgba(0, 0, 0, 0.55) 0px 2px 10px;\"><code style=\"overflow-x: auto; padding: 16px; color: #abb2bf; display: -webkit-box; font-family: Operator Mono, Consolas, Monaco, Menlo, monospace; font-size: 12px; -webkit-overflow-scrolling: touch; padding-top: 15px; background: #282c34; border-radius: 5px;\">template&lt;tyepname T,...&gt;\nstruct __list_iterator{\n    __list_node&lt;T&gt;* node;\n    \/\/...\n    \/\/\u91cd\u8f7d == \u8fd0\u7b97\u7b26\n    bool operator==(const __list_iterator&amp; x){return node == x.node;}\n    \/\/\u91cd\u8f7d != \u8fd0\u7b97\u7b26\n    bool operator!=(const __list_iterator&amp; x){return node != x.node;}\n    \/\/\u91cd\u8f7d * \u8fd0\u7b97\u7b26\uff0c\u8fd4\u56de\u5f15\u7528\u7c7b\u578b\n    T* operator *() const {return *(node).myval;}\n    \/\/\u91cd\u8f7d\u524d\u7f6e ++ \u8fd0\u7b97\u7b26\n    __list_iterator&lt;T&gt;&amp; operator ++(){\n        node = (*node).next;\n        return *this;\n    }\n    \/\/\u91cd\u8f7d\u540e\u7f6e ++ \u8fd0\u7b97\u7b26\n    __list_iterator&lt;T&gt;&amp; operator ++(int){\n        __list_iterator&lt;T&gt; tmp = *this;\n        ++(*this);\n        return tmp;\n    }\n    \/\/\u91cd\u8f7d\u524d\u7f6e -- \u8fd0\u7b97\u7b26\n    __list_iterator&lt;T&gt;&amp; operator--(){\n        node = (*node).prev;\n        return *this;\n    }\n    \/\/\u91cd\u8f7d\u540e\u7f6e -- \u8fd0\u7b97\u7b26\n    __list_iterator&lt;T&gt; operator--(int){\n        __list_iterator&lt;T&gt; tmp = *this;\n        --(*this);\n        return tmp;\n    }\n    \/\/...\n}\n<\/code><\/pre>\n<h3 style=\"margin-top: 30px; margin-bottom: 15px; font-weight: bold; font-size: 20px;\">stack<\/h3>\n<p style=\"padding-top: 8px; padding-bottom: 8px; line-height: 26px;\">stack\u6ca1\u6709\u8fed\u4ee3\u5668\uff0c\u662f\u4e00\u79cd\u5bb9\u5668\u9002\u914d\u5668\uff0c\u7528\u4e8e\u5728LIFO\uff08\u540e\u8fdb\u5148\u51fa\uff09\u7684\u64cd\u4f5c\uff0c\u5176\u4e2d\u5143\u7d20\u4ec5\u4ece\u5bb9\u5668\u7684\u4e00\u7aef\u63d2\u5165\u548c\u63d0\u53d6\u3002<\/p>\n<figure style=\"margin-top: 10px; margin-bottom: 10px;\"><img decoding=\"async\" style=\"display: block; margin-right: auto; margin-left: auto;\" title=\"STL\u603b\u7ed3\u4e0e\u5e38\u89c1\u9762\u8bd5\u9898\" src=\"http:\/\/www.zhushiyao.com\/wp-content\/uploads\/2022\/04\/1-1649301272.jpeg\" alt=\"STL\u603b\u7ed3\u4e0e\u5e38\u89c1\u9762\u8bd5\u9898\" \/><\/figure>\n<p style=\"padding-top: 8px; padding-bottom: 8px; line-height: 26px;\">stack\u5e95\u5c42\u4e00\u822c\u7528list\u6216deque\u5b9e\u73b0\uff0c\u5c01\u95ed\u5934\u90e8\u5373\u53ef\uff0c\u4e0d\u7528vector\u7684\u539f\u56e0\u5e94\u8be5\u662f\u5bb9\u91cf\u5927\u5c0f\u6709\u9650\u5236\uff0c\u6269\u5bb9\u8017\u65f6<\/p>\n<p style=\"padding-top: 8px; padding-bottom: 8px; line-height: 26px;\"><strong>\u5e95\u5c42\u7528deque\u5b9e\u73b0<\/strong>\uff1a<\/p>\n<pre style=\"margin-top: 10px; margin-bottom: 10px; border-radius: 5px; box-shadow: rgba(0, 0, 0, 0.55) 0px 2px 10px;\"><code style=\"overflow-x: auto; padding: 16px; color: #abb2bf; display: -webkit-box; font-family: Operator Mono, Consolas, Monaco, Menlo, monospace; font-size: 12px; -webkit-overflow-scrolling: touch; padding-top: 15px; background: #282c34; border-radius: 5px;\">\/\/deque&lt;T&gt; &gt;\u4e2d\u95f4\u6709\u4e2a\u7a7a\u683c\u662f\u4e3a\u4e86\u517c\u5bb9\u8f83\u8001\u7684\u7248\u672c\ntemplate &lt;class T, class Sequence = deque&lt;T&gt; &gt;\nclass stack {\n    \/\/ \u4ee5\u3198\u7684 __STL_NULL_TMPL_ARGS \u4f1a\u5f00\u5c55\u4e3a &lt;&gt;\n    friend bool operator== __STL_NULL_TMPL_ARGS (const stack&amp;, const stack&amp;);\n    friend bool operator&lt; __STL_NULL_TMPL_ARGS (const stack&amp;, const stack&amp;);\npublic:\n    typedef typename Sequence::value_type value_type;\n    typedef typename Sequence::size_type size_type;\n    typedef typename Sequence::reference reference;\n    typedef typename Sequence::const_reference const_reference;\nprotected:\n    Sequence c; \/\/ \u5e95\u5c42\u5bb9\u5668\npublic:\n    \/\/ \u4ee5\u3198\u5b8c\u5168\u5229\u7528 Sequence c \u7684\u64cd\u4f5c\uff0c\u5b8c\u6210 stack \u7684\u64cd\u4f5c\u3002\n    bool empty() const { return c.empty(); }\n    size_type size() const { return c.size(); }\n    reference top() { return c.back(); }\n    const_reference top() const { return c.back(); }\n    \/\/ deque \u662f\u4e24\u5934\u53ef\u8fdb\u51fa\uff0cstack \u662f\u672b\u7aef\u8fdb\uff0c\u672b\u7aef\u51fa\uff08\u6240\u4ee5\u540e\u8fdb\u8005\u5148\u51fa\uff09\u3002\n    void push(const value_type&amp; x) { c.push_back(x); }\n    void pop() { c.pop_back(); }\n};\n\ntemplate &lt;class T, class Sequence&gt;\nbool operator==(const stack&lt;T, Sequence&gt;&amp; x, const stack&lt;T, Sequence&gt;&amp; y) {\n    return x.c == y.c;\n}\n\ntemplate &lt;class T, class Sequence&gt;\nbool operator&lt;(const stack&lt;T, Sequence&gt;&amp; x, const stack&lt;T, Sequence&gt;&amp; y) {\n    return x.c &lt; y.c;\n}\n<\/code><\/pre>\n<p style=\"padding-top: 8px; padding-bottom: 8px; line-height: 26px;\"><strong>\u5e95\u5c42\u7528list\u5b9e\u73b0<\/strong>\uff1a<\/p>\n<pre style=\"margin-top: 10px; margin-bottom: 10px; border-radius: 5px; box-shadow: rgba(0, 0, 0, 0.55) 0px 2px 10px;\"><code style=\"overflow-x: auto; padding: 16px; color: #abb2bf; display: -webkit-box; font-family: Operator Mono, Consolas, Monaco, Menlo, monospace; font-size: 12px; -webkit-overflow-scrolling: touch; padding-top: 15px; background: #282c34; border-radius: 5px;\">  #include&lt;stack&gt; \u00a0\n  #include&lt;list&gt; \u00a0\n  #include&lt;algorithm&gt; \u00a0\n  #include &lt;iostream&gt; \u00a0\n  using namespace std; \u00a0\n   \u00a0\n  int main(){ \u00a0\n   \u00a0 \u00a0stack&lt;int, list&lt;int&gt;&gt; istack; \u00a0\n   \u00a0 \u00a0istack.push(1); \u00a0\n   \u00a0 \u00a0istack.push(3); \u00a0\n   \u00a0 \u00a0istack.push(5); \u00a0\n   \u00a0 \u00a0 \u00a0\n   \u00a0 \u00a0cout &lt;&lt; istack.size() &lt;&lt; endl; \/\/3 \u00a0\n   \u00a0 \u00a0cout &lt;&lt; istack.top() &lt;&lt; endl;\/\/5 \u00a0\n   \u00a0 \u00a0istack.pop(); \u00a0\n   \u00a0 \u00a0cout &lt;&lt; istack.top() &lt;&lt; endl;\/\/3 \u00a0\n   \u00a0 \u00a0cout &lt;&lt; istack.size() &lt;&lt; endl;\/\/2 \u00a0\n   \u00a0\n   \u00a0 \u00a0system(\"pause\"); \u00a0\n   \u00a0 \u00a0return 0; \u00a0\n  } \u00a0\n<\/code><\/pre>\n<h3 style=\"margin-top: 30px; margin-bottom: 15px; font-weight: bold; font-size: 20px;\">queue<\/h3>\n<p style=\"padding-top: 8px; padding-bottom: 8px; line-height: 26px;\">queue \u662f\u4e00\u79cd\u5bb9\u5668\u9002\u914d\u5668\uff0c\u7528\u4e8e\u5728FIFO\uff08\u5148\u5165\u5148\u51fa\uff09\u7684\u64cd\u4f5c\uff0c\u5176\u4e2d\u5143\u7d20\u63d2\u5165\u5230\u5bb9\u5668\u7684\u4e00\u7aef\u5e76\u4ece\u53e6\u4e00\u7aef\u63d0\u53d6\u3002<\/p>\n<figure style=\"margin-top: 10px; margin-bottom: 10px;\"><img decoding=\"async\" style=\"display: block; margin-right: auto; margin-left: auto;\" title=\"STL\u603b\u7ed3\u4e0e\u5e38\u89c1\u9762\u8bd5\u9898\" src=\"http:\/\/www.zhushiyao.com\/wp-content\/uploads\/2022\/04\/7-1649301273.jpeg\" alt=\"STL\u603b\u7ed3\u4e0e\u5e38\u89c1\u9762\u8bd5\u9898\" \/><\/figure>\n<p style=\"padding-top: 8px; padding-bottom: 8px; line-height: 26px;\">\u961f\u5217\u4e0d\u63d0\u4f9b\u8fed\u4ee3\u5668\uff0c\u4e0d\u5b9e\u73b0\u904d\u5386\u64cd\u4f5c\u3002<\/p>\n<pre style=\"margin-top: 10px; margin-bottom: 10px; border-radius: 5px; box-shadow: rgba(0, 0, 0, 0.55) 0px 2px 10px;\"><code style=\"overflow-x: auto; padding: 16px; color: #abb2bf; display: -webkit-box; font-family: Operator Mono, Consolas, Monaco, Menlo, monospace; font-size: 12px; -webkit-overflow-scrolling: touch; padding-top: 15px; background: #282c34; border-radius: 5px;\">template &lt;class T, class Sequence = deque&lt;T&gt; &gt;\nclass queue {\n  friend bool operator== __STL_NULL_TMPL_ARGS (const queue&amp; x, const queue&amp; y);\n  friend bool operator&lt; __STL_NULL_TMPL_ARGS (const queue&amp; x, const queue&amp; y);\npublic:\n  typedef typename Sequence::value_type value_type;\n  typedef typename Sequence::size_type size_type;\n  typedef typename Sequence::reference reference;\n  typedef typename Sequence::const_reference const_reference;\nprotected:\n  Sequence c;\npublic:\n  bool empty() const { return c.empty(); }\n  size_type size() const { return c.size(); }\n  reference front() { return c.front(); }\n  const_reference front() const { return c.front(); }\n  reference back() { return c.back(); }\n  const_reference back() const { return c.back(); }\n  void push(const value_type&amp; x) { c.push_back(x); }\n  void pop() { c.pop_front(); }\n};\n\ntemplate &lt;class T, class Sequence&gt;\nbool operator==(const queue&lt;T, Sequence&gt;&amp; x, const queue&lt;T, Sequence&gt;&amp; y) {\n  return x.c == y.c;\n}\n\ntemplate &lt;class T, class Sequence&gt;\nbool operator&lt;(const queue&lt;T, Sequence&gt;&amp; x, const queue&lt;T, Sequence&gt;&amp; y) {\n  return x.c &lt; y.c;\n}\n<\/code><\/pre>\n<h3 style=\"margin-top: 30px; margin-bottom: 15px; font-weight: bold; font-size: 20px;\">priority_queue<\/h3>\n<p style=\"padding-top: 8px; padding-bottom: 8px; line-height: 26px;\">\u4f18\u5148\u961f\u5217\uff0c\u5176\u5e95\u5c42\u662f\u7528\u5806\u6765\u5b9e\u73b0\u7684\u3002\u5728\u4f18\u5148\u961f\u5217\u4e2d\uff0c\u961f\u9996\u5143\u7d20\u4e00\u5b9a\u662f\u5f53\u524d\u961f\u5217\u4e2d\u4f18\u5148\u7ea7\u6700\u9ad8\u7684\u90a3\u4e00\u4e2a\u3002<\/p>\n<h3 style=\"margin-top: 30px; margin-bottom: 15px; font-weight: bold; font-size: 20px;\">set<\/h3>\n<p style=\"padding-top: 8px; padding-bottom: 8px; line-height: 26px;\">set \u662f\u6309\u7167\u7279\u5b9a\u987a\u5e8f\u5b58\u50a8\u552f\u4e00\u5143\u7d20\u7684\u5bb9\u5668\u3002<\/p>\n<pre style=\"margin-top: 10px; margin-bottom: 10px; border-radius: 5px; box-shadow: rgba(0, 0, 0, 0.55) 0px 2px 10px;\"><code style=\"overflow-x: auto; padding: 16px; color: #abb2bf; display: -webkit-box; font-family: Operator Mono, Consolas, Monaco, Menlo, monospace; font-size: 12px; -webkit-overflow-scrolling: touch; padding-top: 15px; background: #282c34; border-radius: 5px;\">template&lt;class _Kty,\n    class _Pr = less&lt;_Kty&gt;,\n    class _Alloc = allocator&lt;_Kty&gt; &gt;\nclass set\n<\/code><\/pre>\n<ol class=\"list-paddingleft-1\" style=\"margin-top: 8px; margin-bottom: 8px; padding-left: 25px;\">\n<li>\n<section style=\"margin-top: 5px; margin-bottom: 5px; line-height: 26px; color: #010101;\">set \u7684 \u5e95\u5c42\u6570\u636e\u7ed3\u6784\u662f \u7ea2\u9ed1\u6811\uff0c\u4e00\u79cd\u9ad8\u6548\u7684\u5e73\u8861\u68c0\u7d22\u4e8c\u53c9\u6811\u3002<\/section>\n<\/li>\n<li>\n<section style=\"margin-top: 5px; margin-bottom: 5px; line-height: 26px; color: #010101;\">set \u5bb9\u5668\u4e2d \u6bcf\u4e00\u4e2a\u5143\u7d20\u5c31\u662f\u4e8c\u53c9\u6811\u7684\u6bcf\u4e00\u4e2a\u8282\u70b9\uff0c\u5bf9\u4e8eset\u5bb9\u5668\u7684\u63d2\u5165\u5220\u9664\u64cd\u4f5c\uff0c\u6548\u7387\u90fd\u6bd4\u8f83\u9ad8\uff0c\u539f\u56e0\u662f\u56e0\u4e3a\u4e8c\u53c9\u6811\u7684\u5220\u9664\u63d2\u5165\u5143\u7d20\u5e76\u4e0d\u9700\u8981\u8fdb\u884c\u5185\u5b58\u62f7\u8d1d\u548c\u5185\u5b58\u79fb\u52a8\uff0c\u53ea\u662f\u6539\u53d8\u4e86\u6307\u9488\u7684\u6307\u5411\u3002<\/section>\n<\/li>\n<li>\n<section style=\"margin-top: 5px; margin-bottom: 5px; line-height: 26px; color: #010101;\">\u5bf9 set \u8fdb\u884c\u63d2\u5165\u5220\u9664\u64cd\u4f5c \u90fd\u4e0d\u4f1a\u5f15\u8d77iterator\u7684\u5931\u6548\uff0c\u56e0\u4e3a\u8fed\u4ee3\u5668\u76f8\u5f53\u4e8e\u4e00\u4e2a\u6307\u9488\u6307\u5411\u6bcf\u4e00\u4e2a\u4e8c\u53c9\u6811\u7684\u8282\u70b9\uff0c\u5bf9set\u7684\u63d2\u5165\u5220\u9664\u5e76\u4e0d\u4f1a\u6539\u53d8\u539f\u6709\u5185\u5b58\u4e2d\u8282\u70b9\u7684\u6539\u53d8\uff0c \u4f46\u662fvector\u7684\u63d2\u5165\u5220\u9664\u64cd\u4f5c\u4e00\u822c\u4f1a\u53d1\u751f\u5185\u5b58\u79fb\u52a8\u548c\u5185\u5b58\u62f7\u8d1d\uff0c\u6240\u4ee5\u4f1a\u53d1\u751f\u8fed\u4ee3\u5668\u7684\u5931\u6548\u3002<\/section>\n<\/li>\n<li>\n<section style=\"margin-top: 5px; margin-bottom: 5px; line-height: 26px; color: #010101;\">set\u5bb9\u5668\u7684\u68c0\u7d22\u901f\u5ea6\u5f88\u5feb\uff0c\u56e0\u4e3a\u91c7\u7528\u4e8c\u5206\u67e5\u627e\u7684\u65b9\u6cd5 \u3002<\/section>\n<\/li>\n<\/ol>\n<h3 style=\"margin-top: 30px; margin-bottom: 15px; font-weight: bold; font-size: 20px;\">multiset<\/h3>\n<p style=\"padding-top: 8px; padding-bottom: 8px; line-height: 26px;\"><strong>multiset\u5141\u8bb8\u5143\u7d20\u91cd\u590d\u800cset\u4e0d\u5141\u8bb8<\/strong>\u3002<\/p>\n<pre style=\"margin-top: 10px; margin-bottom: 10px; border-radius: 5px; box-shadow: rgba(0, 0, 0, 0.55) 0px 2px 10px;\"><code style=\"overflow-x: auto; padding: 16px; color: #abb2bf; display: -webkit-box; font-family: Operator Mono, Consolas, Monaco, Menlo, monospace; font-size: 12px; -webkit-overflow-scrolling: touch; padding-top: 15px; background: #282c34; border-radius: 5px;\">template&lt;class _Kty,\n\tclass _Pr = less&lt;_Kty&gt;,\n\tclass _Alloc = allocator&lt;_Kty&gt; &gt;\nclass multiset\n<\/code><\/pre>\n<h3 style=\"margin-top: 30px; margin-bottom: 15px; font-weight: bold; font-size: 20px;\">map<\/h3>\n<p style=\"padding-top: 8px; padding-bottom: 8px; line-height: 26px;\">map \u662f\u5173\u8054\u5bb9\u5668\uff0c\u6309\u7167\u7279\u5b9a\u987a\u5e8f\u5b58\u50a8\u7531 key value (\u952e\u503c) \u548c mapped value (\u6620\u5c04\u503c) \u7ec4\u5408\u5f62\u6210\u7684\u5143\u7d20\u3002<\/p>\n<p style=\"padding-top: 8px; padding-bottom: 8px; line-height: 26px;\">\u7531\u4e8e RB-tree \u662f\u4e00\u79cd\u5e73\u8861\u4e8c\u53c9\u641c\u7d22\u6811\uff0c\u81ea\u52a8\u6392\u5e8f\u7684\u6548\u679c\u5f88\u4e0d\u9519\uff0c\u6240\u4ee5\u6807\u51c6\u7684STL map \u5373\u4ee5 RB-tree \u4e3a\u5e95\u5c42\u673a\u5236\u3002\u53c8\u7531\u4e8e map \u6240\u5f00\u653e\u7684\u5404\u79cd\u64cd\u4f5c\u63a5\u53e3\uff0cRB-tree \u4e5f\u90fd\u63d0\u4f9b\u4e86\uff0c\u6240\u4ee5\u51e0\u4e4e\u6240\u6709\u7684 map \u64cd\u4f5c\u884c\u4e3a\uff0c\u90fd\u53ea\u662f\u8f6c\u8c03 RB-tree \u7684\u64cd\u4f5c\u884c\u4e3a\u3002<\/p>\n<table>\n<thead>\n<tr style=\"border-width: 1px 0px 0px; background-color: white; border-color: #cccccc initial initial initial; border-style: solid initial initial initial;\">\n<th style=\"border-top-width: 1px; border-color: #cccccc; background-color: #f0f0f0; text-align: left;\">\u65b9\u6cd5<\/th>\n<th style=\"border-top-width: 1px; border-color: #cccccc; background-color: #f0f0f0; text-align: center;\">\u8bf4\u660e<\/th>\n<\/tr>\n<\/thead>\n<tbody style=\"border: 0px initial initial;\">\n<tr style=\"border-width: 1px 0px 0px; background-color: white; border-color: #cccccc initial initial initial; border-style: solid initial initial initial;\">\n<td style=\"border-color: #cccccc;\">map<\/td>\n<td style=\"border-color: #cccccc; text-align: center;\">\u6784\u9020\u51fd\u6570<\/td>\n<\/tr>\n<tr style=\"border-width: 1px 0px 0px; background-color: #f8f8f8; border-color: #cccccc initial initial initial; border-style: solid initial initial initial;\">\n<td style=\"border-color: #cccccc;\">begin<\/td>\n<td style=\"border-color: #cccccc; text-align: center;\">\u8fd4\u56de\u5f15\u7528\u5bb9\u5668\u4e2d\u7b2c\u4e00\u4e2a\u5143\u7d20\u7684\u8fed\u4ee3\u5668<\/td>\n<\/tr>\n<tr style=\"border-width: 1px 0px 0px; background-color: white; border-color: #cccccc initial initial initial; border-style: solid initial initial initial;\">\n<td style=\"border-color: #cccccc;\">key_comp<\/td>\n<td style=\"border-color: #cccccc; text-align: center;\">\u8fd4\u56de\u5bb9\u5668\u7528\u4e8e\u6bd4\u8f83\u952e\u7684\u6bd4\u8f83\u5bf9\u8c61\u7684\u526f\u672c<\/td>\n<\/tr>\n<tr style=\"border-width: 1px 0px 0px; background-color: #f8f8f8; border-color: #cccccc initial initial initial; border-style: solid initial initial initial;\">\n<td style=\"border-color: #cccccc;\">value_comp<\/td>\n<td style=\"border-color: #cccccc; text-align: center;\">\u8fd4\u56de\u53ef\u7528\u4e8e\u6bd4\u8f83\u4e24\u4e2a\u5143\u7d20\u7684\u6bd4\u8f83\u5bf9\u8c61\uff0c\u4ee5\u83b7\u53d6\u7b2c\u4e00\u4e2a\u5143\u7d20\u7684\u952e\u662f\u5426\u5728\u7b2c\u4e8c\u4e2a\u5143\u7d20\u4e4b\u524d<\/td>\n<\/tr>\n<tr style=\"border-width: 1px 0px 0px; background-color: white; border-color: #cccccc initial initial initial; border-style: solid initial initial initial;\">\n<td style=\"border-color: #cccccc;\">find<\/td>\n<td style=\"border-color: #cccccc; text-align: center;\">\u5728\u5bb9\u5668\u4e2d\u641c\u7d22\u5177\u6709\u7b49\u4e8e k\u7684\u952e\u7684\u5143\u7d20\uff0c\u5982\u679c\u627e\u5230\u8fd4\u56de\u4e00\u4e2a\u8fed\u4ee3\u5668\uff0c\u5426\u5219\u8fd4\u56de map::end<\/td>\n<\/tr>\n<tr style=\"border-width: 1px 0px 0px; background-color: #f8f8f8; border-color: #cccccc initial initial initial; border-style: solid initial initial initial;\">\n<td style=\"border-color: #cccccc;\">count<\/td>\n<td style=\"border-color: #cccccc; text-align: center;\">\u5728\u5bb9\u5668\u4e2d\u641c\u7d22\u5177\u6709\u7b49\u4e8e k\uff08\u53c2\u6570\uff09\u7684\u952e\u7684\u5143\u7d20\uff0c\u5e76\u8fd4\u56de\u5339\u914d\u7684\u6570\u91cf<\/td>\n<\/tr>\n<tr style=\"border-width: 1px 0px 0px; background-color: white; border-color: #cccccc initial initial initial; border-style: solid initial initial initial;\">\n<td style=\"border-color: #cccccc;\">lower_bound<\/td>\n<td style=\"border-color: #cccccc; text-align: center;\">\u8fd4\u56de\u4e00\u4e2a\u975e\u9012\u51cf\u5e8f\u5217 [first, last)\u4e2d\u7684\u7b2c\u4e00\u4e2a\u5927\u4e8e\u7b49\u4e8e\u503c val\u7684\u4f4d\u7f6e\u7684\u8fed\u4ee3\u5668<\/td>\n<\/tr>\n<tr style=\"border-width: 1px 0px 0px; background-color: #f8f8f8; border-color: #cccccc initial initial initial; border-style: solid initial initial initial;\">\n<td style=\"border-color: #cccccc;\">upper_bound<\/td>\n<td style=\"border-color: #cccccc; text-align: center;\">\u8fd4\u56de\u4e00\u4e2a\u975e\u9012\u51cf\u5e8f\u5217 [first, last)\u4e2d\u7b2c\u4e00\u4e2a\u5927\u4e8e val\u7684\u4f4d\u7f6e\u7684\u8fed\u4ee3\u5668<\/td>\n<\/tr>\n<tr style=\"border-width: 1px 0px 0px; background-color: white; border-color: #cccccc initial initial initial; border-style: solid initial initial initial;\">\n<td style=\"border-color: #cccccc;\">equal_range<\/td>\n<td style=\"border-color: #cccccc; text-align: center;\">\u83b7\u53d6\u76f8\u540c\u5143\u7d20\u7684\u8303\u56f4\uff0c\u8fd4\u56de\u5305\u542b\u5bb9\u5668\u4e2d\u6240\u6709\u5177\u6709\u4e0e k\u7b49\u4ef7\u7684\u952e\u7684\u5143\u7d20\u7684\u8303\u56f4\u8fb9\u754c<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<h3 style=\"margin-top: 30px; margin-bottom: 15px; font-weight: bold; font-size: 20px;\">multimap<\/h3>\n<p style=\"padding-top: 8px; padding-bottom: 8px; line-height: 26px;\">multimap \u7684\u7279\u6027\u4ee5\u53ca\u7528\u6cd5\u4e0e map \u5b8c\u5168\u76f8\u540c\uff0c\u552f\u4e00\u7684\u5dee\u522b\u5728\u4e8e\u5b83\u5141\u8bb8\u952e\u503c\u91cd\u590d\uff0c\u56e0\u6b64\u5b83\u7684\u63d2\u5165\u64cd\u4f5c\u91c7\u7528\u7684\u662f\u5e95\u5c42\u673a\u5236 RB-tree \u7684 insert_equal() \u800c\u975e insert_unique\u3002<\/p>\n<h3 style=\"margin-top: 30px; margin-bottom: 15px; font-weight: bold; font-size: 20px;\">unordered_set<\/h3>\n<p style=\"padding-top: 8px; padding-bottom: 8px; line-height: 26px;\">unordered_set\u662f\u57fa\u4e8e\u54c8\u5e0c\u8868\uff0c\u56e0\u6b64\u8981\u4e86\u89e3unordered_set\uff0c\u5c31\u5fc5\u987b\u4e86\u89e3\u54c8\u5e0c\u8868\u7684\u673a\u5236\u3002\u54c8\u5e0c\u8868\u662f\u6839\u636e\u5173\u952e\u7801\u503c\u800c\u8fdb\u884c\u76f4\u63a5\u8bbf\u95ee\u7684\u6570\u636e\u7ed3\u6784\uff0c\u901a\u8fc7\u76f8\u5e94\u7684\u54c8\u5e0c\u51fd\u6570(\u4e5f\u79f0\u6563\u5217\u51fd\u6570)\u5904\u7406\u5173\u952e\u5b57\u5f97\u5230\u76f8\u5e94\u7684\u5173\u952e\u7801\u503c\uff0c\u5173\u952e\u7801\u503c\u5bf9\u5e94\u7740\u4e00\u4e2a\u7279\u5b9a\u4f4d\u7f6e\uff0c\u7528\u8be5\u4f4d\u7f6e\u6765\u5b58\u53d6\u76f8\u5e94\u7684\u4fe1\u606f\uff0c\u8fd9\u6837\u5c31\u80fd\u4ee5\u8f83\u5feb\u7684\u901f\u5ea6\u83b7\u53d6\u5173\u952e\u5b57\u7684\u4fe1\u606f\u3002<\/p>\n<pre style=\"margin-top: 10px; margin-bottom: 10px; border-radius: 5px; box-shadow: rgba(0, 0, 0, 0.55) 0px 2px 10px;\"><code style=\"overflow-x: auto; padding: 16px; color: #abb2bf; display: -webkit-box; font-family: Operator Mono, Consolas, Monaco, Menlo, monospace; font-size: 12px; -webkit-overflow-scrolling: touch; padding-top: 15px; background: #282c34; border-radius: 5px;\">template\u00a0&lt;\u00a0class\u00a0Key,\u00a0\u00a0\n\u00a0\u00a0\u00a0\u00a0class\u00a0Hash\u00a0=\u00a0hash&lt;Key&gt;,\u00a0\u00a0\n\u00a0\u00a0\u00a0\u00a0class\u00a0Pred\u00a0=\u00a0equal_to&lt;Key&gt;,\u00a0\u00a0\n\u00a0\u00a0\u00a0\u00a0class\u00a0Alloc\u00a0=\u00a0allocator&lt;Key&gt;\u00a0\u00a0\n&gt;\u00a0class\u00a0unordered_set;\u00a0\u00a0\n<\/code><\/pre>\n<h2 style=\"margin-top: 30px; margin-bottom: 15px; font-weight: bold; border-bottom: 2px solid #ef7060; font-size: 1.3em;\"><span style=\"display: inline-block; background: #ef7060; color: #ffffff; padding: 3px 10px 1px; border-top-right-radius: 3px; border-top-left-radius: 3px; margin-right: 3px;\">4 \u7b97\u6cd5<\/span><\/h2>\n<ol class=\"list-paddingleft-1\" style=\"margin-top: 8px; margin-bottom: 8px; padding-left: 25px;\">\n<li>\n<section style=\"margin-top: 5px; margin-bottom: 5px; line-height: 26px; color: #010101;\">\u7b80\u5355\u67e5\u627e\u7b97\u6cd5\uff0c\u8981\u6c42\u8f93\u5165\u8fed\u4ee3\u5668\uff08input iterator\uff09<\/section>\n<\/li>\n<\/ol>\n<pre style=\"margin-top: 10px; margin-bottom: 10px; border-radius: 5px; box-shadow: rgba(0, 0, 0, 0.55) 0px 2px 10px;\"><code style=\"overflow-x: auto; padding: 16px; color: #abb2bf; display: -webkit-box; font-family: Operator Mono, Consolas, Monaco, Menlo, monospace; font-size: 12px; -webkit-overflow-scrolling: touch; padding-top: 15px; background: #282c34; border-radius: 5px;\">find(beg, end, val); \/\/ \u8fd4\u56de\u4e00\u4e2a\u8fed\u4ee3\u5668\uff0c\u6307\u5411\u8f93\u5165\u5e8f\u5217\u4e2d\u7b2c\u4e00\u4e2a\u7b49\u4e8e val \u7684\u5143\u7d20\uff0c\u672a\u627e\u5230\u8fd4\u56de end\nfind_if(beg, end, unaryPred); \/\/ \u8fd4\u56de\u4e00\u4e2a\u8fed\u4ee3\u5668\uff0c\u6307\u5411\u7b2c\u4e00\u4e2a\u6ee1\u8db3 unaryPred \u7684\u5143\u7d20\uff0c\u672a\u627e\u5230\u8fd4\u56de end\nfind_if_not(beg, end, unaryPred); \/\/ \u8fd4\u56de\u4e00\u4e2a\u8fed\u4ee3\u5668\uff0c\u6307\u5411\u7b2c\u4e00\u4e2a\u4ee4 unaryPred \u4e3a false \u7684\u5143\u7d20\uff0c\u672a\u627e\u5230\u8fd4\u56de end\ncount(beg, end, val); \/\/ \u8fd4\u56de\u4e00\u4e2a\u8ba1\u6570\u5668\uff0c\u6307\u51fa val \u51fa\u73b0\u4e86\u591a\u5c11\u6b21\ncount_if(beg, end, unaryPred); \/\/ \u7edf\u8ba1\u6709\u591a\u5c11\u4e2a\u5143\u7d20\u6ee1\u8db3 unaryPred\nall_of(beg, end, unaryPred); \/\/ \u8fd4\u56de\u4e00\u4e2a bool \u503c\uff0c\u5224\u65ad\u662f\u5426\u6240\u6709\u5143\u7d20\u90fd\u6ee1\u8db3 unaryPred\nany_of(beg, end, unaryPred); \/\/ \u8fd4\u56de\u4e00\u4e2a bool \u503c\uff0c\u5224\u65ad\u662f\u5426\u4efb\u610f\uff08\u5b58\u5728\uff09\u4e00\u4e2a\u5143\u7d20\u6ee1\u8db3 unaryPred\nnone_of(beg, end, unaryPred); \/\/ \u8fd4\u56de\u4e00\u4e2a bool \u503c\uff0c\u5224\u65ad\u662f\u5426\u6240\u6709\u5143\u7d20\u90fd\u4e0d\u6ee1\u8db3 unaryPred\n<\/code><\/pre>\n<ol class=\"list-paddingleft-1\" style=\"margin-top: 8px; margin-bottom: 8px; padding-left: 25px;\" start=\"2\">\n<li>\n<section style=\"margin-top: 5px; margin-bottom: 5px; line-height: 26px; color: #010101;\">\u67e5\u627e\u91cd\u590d\u503c\u7684\u7b97\u6cd5\uff0c\u4f20\u5165\u5411\u524d\u8fed\u4ee3\u5668\uff08forward iterator\uff09<\/section>\n<\/li>\n<\/ol>\n<pre style=\"margin-top: 10px; margin-bottom: 10px; border-radius: 5px; box-shadow: rgba(0, 0, 0, 0.55) 0px 2px 10px;\"><code style=\"overflow-x: auto; padding: 16px; color: #abb2bf; display: -webkit-box; font-family: Operator Mono, Consolas, Monaco, Menlo, monospace; font-size: 12px; -webkit-overflow-scrolling: touch; padding-top: 15px; background: #282c34; border-radius: 5px;\">adjacent_find(beg, end); \/\/ \u8fd4\u56de\u6307\u5411\u7b2c\u4e00\u5bf9\u76f8\u90bb\u91cd\u590d\u5143\u7d20\u7684\u8fed\u4ee3\u5668\uff0c\u65e0\u76f8\u90bb\u5143\u7d20\u5219\u8fd4\u56de end\nadjacent_find(beg, end, binaryPred); \/\/ \u8fd4\u56de\u6307\u5411\u7b2c\u4e00\u5bf9\u76f8\u90bb\u91cd\u590d\u5143\u7d20\u7684\u8fed\u4ee3\u5668\uff0c\u65e0\u76f8\u90bb\u5143\u7d20\u5219\u8fd4\u56de end\nsearch_n(beg, end, count, val); \/\/ \u8fd4\u56de\u4e00\u4e2a\u8fed\u4ee3\u5668\uff0c\u4ece\u6b64\u4f4d\u7f6e\u5f00\u59cb\u6709 count \u4e2a\u76f8\u7b49\u5143\u7d20\uff0c\u4e0d\u5b58\u5728\u5219\u8fd4\u56de end\nsearch_n(beg, end, count, val, binaryPred); \/\/ \u8fd4\u56de\u4e00\u4e2a\u8fed\u4ee3\u5668\uff0c\u4ece\u6b64\u4f4d\u7f6e\u5f00\u59cb\u6709 count \u4e2a\u76f8\u7b49\u5143\u7d20\uff0c\u4e0d\u5b58\u5728\u5219\u8fd4\u56de end\n<\/code><\/pre>\n<ol class=\"list-paddingleft-1\" style=\"margin-top: 8px; margin-bottom: 8px; padding-left: 25px;\" start=\"3\">\n<li>\n<section style=\"margin-top: 5px; margin-bottom: 5px; line-height: 26px; color: #010101;\">\u67e5\u627e\u5b50\u5e8f\u5217\u7b97\u6cd5\uff0c\u9664 find_first_of\uff08\u524d\u4e24\u4e2a\u8f93\u5165\u8fed\u4ee3\u5668\uff0c\u540e\u4e24\u4e2a\u524d\u5411\u8fed\u4ee3\u5668\uff09 \u5916\uff0c\u90fd\u8981\u6c42\u4e24\u4e2a\u524d\u5411\u8fed\u4ee3\u5668<\/section>\n<\/li>\n<\/ol>\n<pre style=\"margin-top: 10px; margin-bottom: 10px; border-radius: 5px; box-shadow: rgba(0, 0, 0, 0.55) 0px 2px 10px;\"><code style=\"overflow-x: auto; padding: 16px; color: #abb2bf; display: -webkit-box; font-family: Operator Mono, Consolas, Monaco, Menlo, monospace; font-size: 12px; -webkit-overflow-scrolling: touch; padding-top: 15px; background: #282c34; border-radius: 5px;\">search(beg1, end1, beg2, end2); \/\/ \u8fd4\u56de\u7b2c\u4e8c\u4e2a\u8f93\u5165\u8303\u56f4\uff08\u5b50\u5e8f\u5217\uff09\u5728\u7239\u4e00\u4e2a\u8f93\u5165\u8303\u56f4\u4e2d\u7b2c\u4e00\u6b21\u51fa\u73b0\u7684\u4f4d\u7f6e\uff0c\u672a\u627e\u5230\u5219\u8fd4\u56de end1\nsearch(beg1, end1, beg2, end2, binaryPred); \/\/ \u8fd4\u56de\u7b2c\u4e8c\u4e2a\u8f93\u5165\u8303\u56f4\uff08\u5b50\u5e8f\u5217\uff09\u5728\u7239\u4e00\u4e2a\u8f93\u5165\u8303\u56f4\u4e2d\u7b2c\u4e00\u6b21\u51fa\u73b0\u7684\u4f4d\u7f6e\uff0c\u672a\u627e\u5230\u5219\u8fd4\u56de end1\nfind_first_of(beg1, end1, beg2, end2); \/\/ \u8fd4\u56de\u4e00\u4e2a\u8fed\u4ee3\u5668\uff0c\u6307\u5411\u7b2c\u4e8c\u4e2a\u8f93\u5165\u8303\u56f4\u4e2d\u4efb\u610f\u5143\u7d20\u5728\u7b2c\u4e00\u4e2a\u8303\u56f4\u4e2d\u9996\u6b21\u51fa\u73b0\u7684\u4f4d\u7f6e\uff0c\u672a\u627e\u5230\u5219\u8fd4\u56deend1\nfind_first_of(beg1, end1, beg2, end2, binaryPred); \/\/ \u8fd4\u56de\u4e00\u4e2a\u8fed\u4ee3\u5668\uff0c\u6307\u5411\u7b2c\u4e8c\u4e2a\u8f93\u5165\u8303\u56f4\u4e2d\u4efb\u610f\u5143\u7d20\u5728\u7b2c\u4e00\u4e2a\u8303\u56f4\u4e2d\u9996\u6b21\u51fa\u73b0\u7684\u4f4d\u7f6e\uff0c\u672a\u627e\u5230\u5219\u8fd4\u56deend1\nfind_end(beg1, end1, beg2, end2); \/\/ \u7c7b\u4f3c search\uff0c\u4f46\u8fd4\u56de\u7684\u6700\u540e\u4e00\u6b21\u51fa\u73b0\u7684\u4f4d\u7f6e\u3002\u5982\u679c\u7b2c\u4e8c\u4e2a\u8f93\u5165\u8303\u56f4\u4e3a\u7a7a\uff0c\u6216\u8005\u5728\u7b2c\u4e00\u4e2a\u8f93\u5165\u8303\u56f4\u4e3a\u7a7a\uff0c\u6216\u8005\u5728\u7b2c\u4e00\u4e2a\u8f93\u5165\u8303\u56f4\u4e2d\u672a\u627e\u5230\u5b83\uff0c\u5219\u8fd4\u56de end1\nfind_end(beg1, end1, beg2, end2, binaryPred); \/\/ \u7c7b\u4f3c search\uff0c\u4f46\u8fd4\u56de\u7684\u6700\u540e\u4e00\u6b21\u51fa\u73b0\u7684\u4f4d\u7f6e\u3002\u5982\u679c\u7b2c\u4e8c\u4e2a\u8f93\u5165\u8303\u56f4\u4e3a\u7a7a\uff0c\u6216\u8005\u5728\u7b2c\u4e00\u4e2a\u8f93\u5165\u8303\u56f4\u4e3a\u7a7a\uff0c\u6216\u8005\u5728\u7b2c\u4e00\u4e2a\u8f93\u5165\u8303\u56f4\u4e2d\u672a\u627e\u5230\u5b83\uff0c\u5219\u8fd4\u56de end1\n<\/code><\/pre>\n<ol class=\"list-paddingleft-1\" style=\"margin-top: 8px; margin-bottom: 8px; padding-left: 25px;\" start=\"4\">\n<li>\n<section style=\"margin-top: 5px; margin-bottom: 5px; line-height: 26px; color: #010101;\">\u5176\u4ed6\u53ea\u8bfb\u7b97\u6cd5\uff0c\u4f20\u5165\u8f93\u5165\u8fed\u4ee3\u5668<\/section>\n<\/li>\n<\/ol>\n<pre style=\"margin-top: 10px; margin-bottom: 10px; border-radius: 5px; box-shadow: rgba(0, 0, 0, 0.55) 0px 2px 10px;\"><code style=\"overflow-x: auto; padding: 16px; color: #abb2bf; display: -webkit-box; font-family: Operator Mono, Consolas, Monaco, Menlo, monospace; font-size: 12px; -webkit-overflow-scrolling: touch; padding-top: 15px; background: #282c34; border-radius: 5px;\">for_each(beg, end, unaryOp); \/\/ \u5bf9\u8f93\u5165\u5e8f\u5217\u4e2d\u7684\u6bcf\u4e2a\u5143\u7d20\u5e94\u7528\u53ef\u8c03\u7528\u5bf9\u8c61 unaryOp\uff0cunaryOp \u7684\u8fd4\u56de\u503c\u88ab\u5ffd\u7565\nmismatch(beg1, end1, beg2); \/\/ \u6bd4\u8f83\u4e24\u4e2a\u5e8f\u5217\u4e2d\u7684\u5143\u7d20\u3002\u8fd4\u56de\u4e00\u4e2a\u8fed\u4ee3\u5668\u7684 pair\uff0c\u8868\u793a\u4e24\u4e2a\u5e8f\u5217\u4e2d\u7b2c\u4e00\u4e2a\u4e0d\u5339\u914d\u7684\u5143\u7d20\nmismatch(beg1, end1, beg2, binaryPred); \/\/ \u6bd4\u8f83\u4e24\u4e2a\u5e8f\u5217\u4e2d\u7684\u5143\u7d20\u3002\u8fd4\u56de\u4e00\u4e2a\u8fed\u4ee3\u5668\u7684 pair\uff0c\u8868\u793a\u4e24\u4e2a\u5e8f\u5217\u4e2d\u7b2c\u4e00\u4e2a\u4e0d\u5339\u914d\u7684\u5143\u7d20\nequal(beg1, end1, beg2); \/\/ \u6bd4\u8f83\u6bcf\u4e2a\u5143\u7d20\uff0c\u786e\u5b9a\u4e24\u4e2a\u5e8f\u5217\u662f\u5426\u76f8\u7b49\u3002\nequal(beg1, end1, beg2, binaryPred); \/\/ \u6bd4\u8f83\u6bcf\u4e2a\u5143\u7d20\uff0c\u786e\u5b9a\u4e24\u4e2a\u5e8f\u5217\u662f\u5426\u76f8\u7b49\u3002\n<\/code><\/pre>\n<ol class=\"list-paddingleft-1\" style=\"margin-top: 8px; margin-bottom: 8px; padding-left: 25px;\" start=\"5\">\n<li>\n<section style=\"margin-top: 5px; margin-bottom: 5px; line-height: 26px; color: #010101;\">\u4e8c\u5206\u641c\u7d22\u7b97\u6cd5\uff0c\u4f20\u5165\u524d\u5411\u8fed\u4ee3\u5668\u6216\u968f\u673a\u8bbf\u95ee\u8fed\u4ee3\u5668\uff08random-access iterator\uff09\uff0c\u8981\u6c42\u5e8f\u5217\u4e2d\u7684\u5143\u7d20\u5df2\u7ecf\u662f\u6709\u5e8f\u7684<\/section>\n<\/li>\n<\/ol>\n<pre style=\"margin-top: 10px; margin-bottom: 10px; border-radius: 5px; box-shadow: rgba(0, 0, 0, 0.55) 0px 2px 10px;\"><code style=\"overflow-x: auto; padding: 16px; color: #abb2bf; display: -webkit-box; font-family: Operator Mono, Consolas, Monaco, Menlo, monospace; font-size: 12px; -webkit-overflow-scrolling: touch; padding-top: 15px; background: #282c34; border-radius: 5px;\">lower_bound(beg, end, val); \/\/ \u8fd4\u56de\u4e00\u4e2a\u975e\u9012\u51cf\u5e8f\u5217 [beg, end) \u4e2d\u7684\u7b2c\u4e00\u4e2a\u5927\u4e8e\u7b49\u4e8e\u503c val \u7684\u4f4d\u7f6e\u7684\u8fed\u4ee3\u5668\uff0c\u4e0d\u5b58\u5728\u5219\u8fd4\u56de end\nlower_bound(beg, end, val, comp); \/\/ \u8fd4\u56de\u4e00\u4e2a\u975e\u9012\u51cf\u5e8f\u5217 [beg, end) \u4e2d\u7684\u7b2c\u4e00\u4e2a\u5927\u4e8e\u7b49\u4e8e\u503c val \u7684\u4f4d\u7f6e\u7684\u8fed\u4ee3\u5668\uff0c\u4e0d\u5b58\u5728\u5219\u8fd4\u56de end\nupper_bound(beg, end, val); \/\/ \u8fd4\u56de\u4e00\u4e2a\u975e\u9012\u51cf\u5e8f\u5217 [beg, end) \u4e2d\u7b2c\u4e00\u4e2a\u5927\u4e8e val \u7684\u4f4d\u7f6e\u7684\u8fed\u4ee3\u5668\uff0c\u4e0d\u5b58\u5728\u5219\u8fd4\u56de end\nupper_bound(beg, end, val, comp); \/\/ \u8fd4\u56de\u4e00\u4e2a\u975e\u9012\u51cf\u5e8f\u5217 [beg, end) \u4e2d\u7b2c\u4e00\u4e2a\u5927\u4e8e val \u7684\u4f4d\u7f6e\u7684\u8fed\u4ee3\u5668\uff0c\u4e0d\u5b58\u5728\u5219\u8fd4\u56de end\nequal_range(beg, end, val); \/\/ \u8fd4\u56de\u4e00\u4e2a pair\uff0c\u5176 first \u6210\u5458\u662f lower_bound \u8fd4\u56de\u7684\u8fed\u4ee3\u5668\uff0c\u5176 second \u6210\u5458\u662f upper_bound \u8fd4\u56de\u7684\u8fed\u4ee3\u5668\nbinary_search(beg, end, val); \/\/ \u8fd4\u56de\u4e00\u4e2a bool \u503c\uff0c\u6307\u51fa\u5e8f\u5217\u4e2d\u662f\u5426\u5305\u542b\u7b49\u4e8e val \u7684\u5143\u7d20\u3002\u5bf9\u4e8e\u4e24\u4e2a\u503c x \u548c y\uff0c\u5f53 x \u4e0d\u5c0f\u4e8e y \u4e14 y \u4e5f\u4e0d\u5c0f\u4e8e x \u65f6\uff0c\u8ba4\u4e3a\u5b83\u4eec\u76f8\u7b49\u3002\n<\/code><\/pre>\n<ol class=\"list-paddingleft-1\" style=\"margin-top: 8px; margin-bottom: 8px; padding-left: 25px;\" start=\"6\">\n<li>\n<section style=\"margin-top: 5px; margin-bottom: 5px; line-height: 26px; color: #010101;\">\u53ea\u5199\u4e0d\u8bfb\u7b97\u6cd5\uff0c\u8981\u6c42\u8f93\u51fa\u8fed\u4ee3\u5668\uff08output iterator\uff09<\/section>\n<\/li>\n<\/ol>\n<pre style=\"margin-top: 10px; margin-bottom: 10px; border-radius: 5px; box-shadow: rgba(0, 0, 0, 0.55) 0px 2px 10px;\"><code style=\"overflow-x: auto; padding: 16px; color: #abb2bf; display: -webkit-box; font-family: Operator Mono, Consolas, Monaco, Menlo, monospace; font-size: 12px; -webkit-overflow-scrolling: touch; padding-top: 15px; background: #282c34; border-radius: 5px;\">fill(beg, end, val); \/\/ \u5c06 val \u8d4b\u4e88\u6bcf\u4e2a\u5143\u7d20\uff0c\u8fd4\u56de void\nfill_n(beg, cnt, val); \/\/ \u5c06 val \u8d4b\u4e88 cnt \u4e2a\u5143\u7d20\uff0c\u8fd4\u56de\u6307\u5411\u5199\u5165\u5230\u8f93\u51fa\u5e8f\u5217\u6700\u6709\u4e00\u4e2a\u5143\u7d20\u4e4b\u540e\u4f4d\u7f6e\u7684\u8fed\u4ee3\u5668\ngenetate(beg, end, Gen); \/\/ \u6bcf\u6b21\u8c03\u7528 Gen() \u751f\u6210\u4e0d\u540c\u7684\u503c\u8d4b\u4e88\u6bcf\u4e2a\u5e8f\u5217\uff0c\u8fd4\u56de void\ngenetate_n(beg, cnt, Gen); \/\/ \u6bcf\u6b21\u8c03\u7528 Gen() \u751f\u6210\u4e0d\u540c\u7684\u503c\u8d4b\u4e88 cnt \u4e2a\u5e8f\u5217\uff0c\u8fd4\u56de\u6307\u5411\u5199\u5165\u5230\u8f93\u51fa\u5e8f\u5217\u6700\u6709\u4e00\u4e2a\u5143\u7d20\u4e4b\u540e\u4f4d\u7f6e\u7684\u8fed\u4ee3\u5668\n<\/code><\/pre>\n<p style=\"padding-top: 8px; padding-bottom: 8px; line-height: 26px;\">7.\u4f7f\u7528\u8f93\u5165\u8fed\u4ee3\u5668\u7684\u5199\u7b97\u6cd5\uff0c\u8bfb\u53d6\u4e00\u4e2a\u8f93\u5165\u5e8f\u5217\uff0c\u5c06\u503c\u5199\u5165\u5230\u4e00\u4e2a\u8f93\u51fa\u5e8f\u5217\uff08dest\uff09\u4e2d<\/p>\n<pre style=\"margin-top: 10px; margin-bottom: 10px; border-radius: 5px; box-shadow: rgba(0, 0, 0, 0.55) 0px 2px 10px;\"><code style=\"overflow-x: auto; padding: 16px; color: #abb2bf; display: -webkit-box; font-family: Operator Mono, Consolas, Monaco, Menlo, monospace; font-size: 12px; -webkit-overflow-scrolling: touch; padding-top: 15px; background: #282c34; border-radius: 5px;\">copy(beg, end, dest); \/\/ \u4ece\u8f93\u5165\u8303\u56f4\u5c06\u5143\u7d20\u62f7\u8d1d\u6240\u6709\u5143\u7d20\u5230 dest \u6307\u5b9a\u5b9a\u7684\u76ee\u7684\u5e8f\u5217\ncopy_if(beg, end, dest, unaryPred); \/\/ \u4ece\u8f93\u5165\u8303\u56f4\u5c06\u5143\u7d20\u62f7\u8d1d\u6ee1\u8db3 unaryPred \u7684\u5143\u7d20\u5230 dest \u6307\u5b9a\u5b9a\u7684\u76ee\u7684\u5e8f\u5217\ncopy_n(beg, n, dest); \/\/ \u4ece\u8f93\u5165\u8303\u56f4\u5c06\u5143\u7d20\u62f7\u8d1d\u524d n \u4e2a\u5143\u7d20\u5230 dest \u6307\u5b9a\u5b9a\u7684\u76ee\u7684\u5e8f\u5217\nmove(beg, end, dest); \/\/ \u5bf9\u8f93\u5165\u5e8f\u5217\u4e2d\u7684\u6bcf\u4e2a\u5143\u7d20\u8c03\u7528 std::move\uff0c\u5c06\u5176\u79fb\u52a8\u5230\u8fed\u4ee3\u5668 dest \u5f00\u59cb\u59cb\u7684\u5e8f\u5217\u4e2d\ntransform(beg, end, dest, unaryOp); \/\/ \u8c03\u7528\u7ed9\u5b9a\u64cd\u4f5c\uff08\u4e00\u5143\u64cd\u4f5c\uff09\uff0c\u5e76\u5c06\u7ed3\u679c\u5199\u5230dest\u4e2d\ntransform(beg, end, beg2, dest, binaryOp); \/\/ \u8c03\u7528\u7ed9\u5b9a\u64cd\u4f5c\uff08\u4e8c\u5143\u64cd\u4f5c\uff09\uff0c\u5e76\u5c06\u7ed3\u679c\u5199\u5230dest\u4e2d\nreplace_copy(beg, end, dest, old_val, new_val); \/\/ \u5c06\u6bcf\u4e2a\u5143\u7d20\u62f7\u8d1d\u5230 dest\uff0c\u5c06\u7b49\u4e8e old_val \u7684\u7684\u5143\u7d20\u66ff\u6362\u4e3a new_val\nreplace_copy_if(beg, end, dest, unaryPred, new_val); \/\/ \u5c06\u6bcf\u4e2a\u5143\u7d20\u62f7\u8d1d\u5230 dest\uff0c\u5c06\u6ee1\u8db3 unaryPred \u7684\u7684\u5143\u7d20\u66ff\u6362\u4e3a new_val\nmerge(beg1, end1, beg2, end2, dest); \/\/ \u4e24\u4e2a\u8f93\u5165\u5e8f\u5217\u5fc5\u987b\u90fd\u662f\u6709\u5e8f\u7684\uff0c\u7528\u5c0f\u4e8e\u53f7\u8fd0\u7b97\u7b26\u5c06\u5408\u5e76\u540e\u7684\u5e8f\u5217\u5199\u5165\u5230 dest \u4e2d\nmerge(beg1, end1, beg2, end2, dest, comp); \/\/ \u4e24\u4e2a\u8f93\u5165\u5e8f\u5217\u5fc5\u987b\u90fd\u662f\u6709\u5e8f\u7684\uff0c\u4f7f\u7528\u7ed9\u5b9a\u7684\u6bd4\u8f83\u64cd\u4f5c\uff08comp\uff09\u5c06\u5408\u5e76\u540e\u7684\u5e8f\u5217\u5199\u5165\u5230 dest \u4e2d\n<\/code><\/pre>\n<p style=\"padding-top: 8px; padding-bottom: 8px; line-height: 26px;\">8.\u5212\u5206\u7b97\u6cd5\uff0c\u8981\u6c42\u53cc\u5411\u9009\u4ee3\u5668\uff08bidirectional iterator\uff09<\/p>\n<pre style=\"margin-top: 10px; margin-bottom: 10px; border-radius: 5px; box-shadow: rgba(0, 0, 0, 0.55) 0px 2px 10px;\"><code style=\"overflow-x: auto; padding: 16px; color: #abb2bf; display: -webkit-box; font-family: Operator Mono, Consolas, Monaco, Menlo, monospace; font-size: 12px; -webkit-overflow-scrolling: touch; padding-top: 15px; background: #282c34; border-radius: 5px;\">is_partitioned(beg, end, unaryPred); \/\/ \u5982\u679c\u6240\u6709\u6ee1\u8db3\u8c13\u8bcd unaryPred \u7684\u5143\u7d20\u90fd\u5728\u4e0d\u6ee1\u8db3 unarypred \u7684\u5143\u7d20\u4e4b\u524d\uff0c\u5219\u8fd4\u56de true\u3002\u82e5\u5e8f\u5217\u4e3a\u7a7a\uff0c\u4e5f\u8fd4\u56de true\npartition_copy(beg, end, dest1, dest2, unaryPred); \/\/ \u5c06\u6ee1\u8db3 unaryPred \u7684\u5143\u7d20\u62f7\u8d1d\u5230\u5230 dest1\uff0c\u5e76\u5c06\u4e0d\u6ee1\u8db3 unaryPred \u7684\u5143\u7d20\u62f7\u8d1d\u5230\u5230 dest2\u3002\u8fd4\u56de\u4e00\u4e2a\u8fed\u4ee3\u5668 pair\uff0c\u5176 first \u6210\u5458\u8868\u793a\u62f7\u8d1d\u5230 dest1 \u7684\u7684\u5143\u7d20\u7684\u672b\u5c3e\uff0csecond \u8868\u793a\u62f7\u8d1d\u5230 dest2 \u7684\u5143\u7d20\u7684\u672b\u5c3e\u3002\npartitioned_point(beg, end, unaryPred); \/\/ \u8f93\u5165\u5e8f\u5217\u5fc5\u987b\u662f\u5df2\u7ecf\u7528 unaryPred \u5212\u5206\u8fc7\u7684\u3002\u8fd4\u56de\u6ee1\u8db3  unaryPred \u7684\u8303\u56f4\u7684\u5c3e\u540e\u8fed\u4ee3\u5668\u3002\u5982\u679c\u8fd4\u56de\u7684\u8fed\u4ee3\u5668\u4e0d\u662f end\uff0c\u5219\u5b83\u6307\u5411\u7684\u5143\u7d20\u53ca\u5176\u540e\u7684\u5143\u7d20\u5fc5\u987b\u90fd\u4e0d\u6ee1\u8db3 unaryPred\nstable_partition(beg, end, unaryPred); \/\/ \u4f7f\u7528 unaryPred \u5212\u5206\u8f93\u5165\u5e8f\u5217\u3002\u6ee1\u8db3 unaryPred \u7684\u5143\u7d20\u653e\u7f6e\u5728\u5e8f\u5217\u5f00\u59cb\uff0c\u4e0d\u6ee1\u8db3\u7684\u5143\u7d20\u653e\u5728\u5e8f\u5217\u5c3e\u90e8\u3002\u8fd4\u56de\u4e00\u4e2a\u8fed\u4ee3\u5668\uff0c\u6307\u5411\u6700\u540e\u4e00\u4e2a\u6ee1\u8db3 unaryPred \u7684\u5143\u7d20\u4e4b\u540e\u7684\u4f4d\u7f6e\u5982\u679c\u6240\u6709\u5143\u7d20\u90fd\u4e0d\u6ee1\u8db3 unaryPred\uff0c\u5219\u8fd4\u56de beg\npartition(beg, end, unaryPred); \/\/ \u4f7f\u7528 unaryPred \u5212\u5206\u8f93\u5165\u5e8f\u5217\u3002\u6ee1\u8db3 unaryPred \u7684\u5143\u7d20\u653e\u7f6e\u5728\u5e8f\u5217\u5f00\u59cb\uff0c\u4e0d\u6ee1\u8db3\u7684\u5143\u7d20\u653e\u5728\u5e8f\u5217\u5c3e\u90e8\u3002\u8fd4\u56de\u4e00\u4e2a\u8fed\u4ee3\u5668\uff0c\u6307\u5411\u6700\u540e\u4e00\u4e2a\u6ee1\u8db3 unaryPred \u7684\u5143\u7d20\u4e4b\u540e\u7684\u4f4d\u7f6e\u5982\u679c\u6240\u6709\u5143\u7d20\u90fd\u4e0d\u6ee1\u8db3 unaryPred\uff0c\u5219\u8fd4\u56de beg\n<\/code><\/pre>\n<ol class=\"list-paddingleft-1\" style=\"margin-top: 8px; margin-bottom: 8px; padding-left: 25px;\" start=\"9\">\n<li>\n<section style=\"margin-top: 5px; margin-bottom: 5px; line-height: 26px; color: #010101;\">\u6392\u5e8f\u7b97\u6cd5\uff0c\u8981\u6c42\u968f\u673a\u8bbf\u95ee\u8fed\u4ee3\u5668\uff08random-access iterator\uff09<\/section>\n<\/li>\n<\/ol>\n<pre style=\"margin-top: 10px; margin-bottom: 10px; border-radius: 5px; box-shadow: rgba(0, 0, 0, 0.55) 0px 2px 10px;\"><code style=\"overflow-x: auto; padding: 16px; color: #abb2bf; display: -webkit-box; font-family: Operator Mono, Consolas, Monaco, Menlo, monospace; font-size: 12px; -webkit-overflow-scrolling: touch; padding-top: 15px; background: #282c34; border-radius: 5px;\">sort(beg, end); \/\/ \u6392\u5e8f\u6574\u4e2a\u8303\u56f4\nstable_sort(beg, end); \/\/ \u6392\u5e8f\u6574\u4e2a\u8303\u56f4\uff08\u7a33\u5b9a\u6392\u5e8f\uff09\nsort(beg, end, comp); \/\/ \u6392\u5e8f\u6574\u4e2a\u8303\u56f4\nstable_sort(beg, end, comp); \/\/ \u6392\u5e8f\u6574\u4e2a\u8303\u56f4\uff08\u7a33\u5b9a\u6392\u5e8f\uff09\nis_sorted(beg, end); \/\/ \u8fd4\u56de\u4e00\u4e2a bool \u503c\uff0c\u6307\u51fa\u6574\u4e2a\u8f93\u5165\u5e8f\u5217\u662f\u5426\u6709\u5e8f\nis_sorted(beg, end, comp); \/\/ \u8fd4\u56de\u4e00\u4e2a bool \u503c\uff0c\u6307\u51fa\u6574\u4e2a\u8f93\u5165\u5e8f\u5217\u662f\u5426\u6709\u5e8f\nis_sorted_until(beg, end); \/\/ \u5728\u8f93\u5165\u5e8f\u5217\u4e2d\u67fb\u627e\u6700\u957f\u521d\u59cb\u6709\u5e8f\u5b50\u5e8f\u5217\uff0c\u5e76\u8fd4\u56de\u5b50\u5e8f\u5217\u7684\u5c3e\u540e\u8fed\u4ee3\u5668\nis_sorted_until(beg, end, comp); \/\/ \u5728\u8f93\u5165\u5e8f\u5217\u4e2d\u67fb\u627e\u6700\u957f\u521d\u59cb\u6709\u5e8f\u5b50\u5e8f\u5217\uff0c\u5e76\u8fd4\u56de\u5b50\u5e8f\u5217\u7684\u5c3e\u540e\u8fed\u4ee3\u5668\npartial_sort(beg, mid, end); \/\/ \u6392\u5e8f mid-beg \u4e2a\u5143\u7d20\u3002\u5373\uff0c\u5982\u679c mid-beg \u7b49\u4e8e 42\uff0c\u5219\u6b64\u51fd\u6570\u5c06\u503c\u6700\u5c0f\u7684 42 \u4e2a\u5143\u7d20\u6709\u5e8f\u653e\u5728\u5e8f\u5217\u524d 42 \u4e2a\u4f4d\u7f6e\npartial_sort(beg, mid, end, comp); \/\/ \u6392\u5e8f mid-beg \u4e2a\u5143\u7d20\u3002\u5373\uff0c\u5982\u679c mid-beg \u7b49\u4e8e 42\uff0c\u5219\u6b64\u51fd\u6570\u5c06\u503c\u6700\u5c0f\u7684 42 \u4e2a\u5143\u7d20\u6709\u5e8f\u653e\u5728\u5e8f\u5217\u524d 42 \u4e2a\u4f4d\u7f6e\npartial_sort_copy(beg, end, destBeg, destEnd); \/\/ \u6392\u5e8f\u8f93\u5165\u8303\u56f4\u4e2d\u7684\u5143\u7d20\uff0c\u5e76\u5c06\u8db3\u591f\u591a\u7684\u5df2\u6392\u5e8f\u5143\u7d20\u653e\u5230 destBeg \u548c destEnd \u6240\u6307\u793a\u7684\u5e8f\u5217\u4e2d\npartial_sort_copy(beg, end, destBeg, destEnd, comp); \/\/ \u6392\u5e8f\u8f93\u5165\u8303\u56f4\u4e2d\u7684\u5143\u7d20\uff0c\u5e76\u5c06\u8db3\u591f\u591a\u7684\u5df2\u6392\u5e8f\u5143\u7d20\u653e\u5230 destBeg \u548c destEnd \u6240\u6307\u793a\u7684\u5e8f\u5217\u4e2d\nnth_element(beg, nth, end); \/\/ nth \u662f\u4e00\u4e2a\u8fed\u4ee3\u5668\uff0c\u6307\u5411\u8f93\u5165\u5e8f\u5217\u4e2d\u7b2c n \u5927\u7684\u5143\u7d20\u3002nth \u4e4b\u524d\u7684\u5143\u7d20\u90fd\u5c0f\u4e8e\u7b49\u4e8e\u5b83\uff0c\u800c\u4e4b\u540e\u7684\u5143\u7d20\u90fd\u5927\u4e8e\u7b49\u4e8e\u5b83\nnth_element(beg, nth, end, comp); \/\/ nth \u662f\u4e00\u4e2a\u8fed\u4ee3\u5668\uff0c\u6307\u5411\u8f93\u5165\u5e8f\u5217\u4e2d\u7b2c n \u5927\u7684\u5143\u7d20\u3002nth \u4e4b\u524d\u7684\u5143\u7d20\u90fd\u5c0f\u4e8e\u7b49\u4e8e\u5b83\uff0c\u800c\u4e4b\u540e\u7684\u5143\u7d20\u90fd\u5927\u4e8e\u7b49\u4e8e\u5b83\n<\/code><\/pre>\n<ol class=\"list-paddingleft-1\" style=\"margin-top: 8px; margin-bottom: 8px; padding-left: 25px;\" start=\"10\">\n<li>\n<section style=\"margin-top: 5px; margin-bottom: 5px; line-height: 26px; color: #010101;\">\u4f7f\u7528\u524d\u5411\u8fed\u4ee3\u5668\u7684\u91cd\u6392\u7b97\u6cd5\u3002\u666e\u901a\u7248\u672c\u5728\u8f93\u5165\u5e8f\u5217\u81ea\u8eab\u5185\u90e8\u91cd\u62cd\u5143\u7d20\uff0c_copy \u7248\u672c\u5b8c\u6210\u91cd\u62cd\u540e\u5199\u5165\u5230\u6307\u5b9a\u76ee\u7684\u5e8f\u5217\u4e2d\uff0c\u800c\u4e0d\u6539\u53d8\u8f93\u5165\u5e8f\u5217<\/section>\n<\/li>\n<\/ol>\n<pre style=\"margin-top: 10px; margin-bottom: 10px; border-radius: 5px; box-shadow: rgba(0, 0, 0, 0.55) 0px 2px 10px;\"><code style=\"overflow-x: auto; padding: 16px; color: #abb2bf; display: -webkit-box; font-family: Operator Mono, Consolas, Monaco, Menlo, monospace; font-size: 12px; -webkit-overflow-scrolling: touch; padding-top: 15px; background: #282c34; border-radius: 5px;\">remove(beg, end, val); \/\/ \u901a\u8fc7\u7528\u4fdd\u7559\u7684\u5143\u7d20\u8986\u76d6\u8981\u5220\u9664\u7684\u5143\u7d20\u5b9e\u73b0\u5220\u9664 ==val \u7684\u5143\u7d20\uff0c\u8fd4\u56de\u4e00\u4e2a\u6307\u5411\u6700\u540e\u4e00\u4e2a\u5220\u9664\u5143\u7d20\u7684\u5c3e\u540e\u4f4d\u7f6e\u7684\u8fed\u4ee3\u5668\nremove_if(beg, end, unaryPred); \/\/ \u901a\u8fc7\u7528\u4fdd\u7559\u7684\u5143\u7d20\u8986\u76d6\u8981\u5220\u9664\u7684\u5143\u7d20\u5b9e\u73b0\u5220\u9664\u6ee1\u8db3 unaryPred \u7684\u5143\u7d20\uff0c\u8fd4\u56de\u4e00\u4e2a\u6307\u5411\u6700\u540e\u4e00\u4e2a\u5220\u9664\u5143\u7d20\u7684\u5c3e\u540e\u4f4d\u7f6e\u7684\u8fed\u4ee3\u5668\nremove_copy(beg, end, dest, val); \/\/ \u901a\u8fc7\u7528\u4fdd\u7559\u7684\u5143\u7d20\u8986\u76d6\u8981\u5220\u9664\u7684\u5143\u7d20\u5b9e\u73b0\u5220\u9664 ==val \u7684\u5143\u7d20\uff0c\u8fd4\u56de\u4e00\u4e2a\u6307\u5411\u6700\u540e\u4e00\u4e2a\u5220\u9664\u5143\u7d20\u7684\u5c3e\u540e\u4f4d\u7f6e\u7684\u8fed\u4ee3\u5668\nremove_copy_if(beg, end, dest, unaryPred); \/\/ \u901a\u8fc7\u7528\u4fdd\u7559\u7684\u5143\u7d20\u8986\u76d6\u8981\u5220\u9664\u7684\u5143\u7d20\u5b9e\u73b0\u5220\u9664\u6ee1\u8db3 unaryPred \u7684\u5143\u7d20\uff0c\u8fd4\u56de\u4e00\u4e2a\u6307\u5411\u6700\u540e\u4e00\u4e2a\u5220\u9664\u5143\u7d20\u7684\u5c3e\u540e\u4f4d\u7f6e\u7684\u8fed\u4ee3\u5668\nunique(beg, end); \/\/ \u901a\u8fc7\u5bf9\u8986\u76d6\u76f8\u90bb\u7684\u91cd\u590d\u5143\u7d20\uff08\u7528 == \u786e\u5b9a\u662f\u5426\u76f8\u540c\uff09\u5b9e\u73b0\u91cd\u6392\u5e8f\u5217\u3002\u8fd4\u56de\u4e00\u4e2a\u8fed\u4ee3\u5668\uff0c\u6307\u5411\u4e0d\u91cd\u590d\u5143\u7d20\u7684\u5c3e\u540e\u4f4d\u7f6e\nunique (beg, end, binaryPred); \/\/ \u901a\u8fc7\u5bf9\u8986\u76d6\u76f8\u90bb\u7684\u91cd\u590d\u5143\u7d20\uff08\u7528 binaryPred \u786e\u5b9a\u662f\u5426\u76f8\u540c\uff09\u5b9e\u73b0\u91cd\u6392\u5e8f\u5217\u3002\u8fd4\u56de\u4e00\u4e2a\u8fed\u4ee3\u5668\uff0c\u6307\u5411\u4e0d\u91cd\u590d\u5143\u7d20\u7684\u5c3e\u540e\u4f4d\u7f6e\nunique_copy(beg, end, dest); \/\/ \u901a\u8fc7\u5bf9\u8986\u76d6\u76f8\u90bb\u7684\u91cd\u590d\u5143\u7d20\uff08\u7528 == \u786e\u5b9a\u662f\u5426\u76f8\u540c\uff09\u5b9e\u73b0\u91cd\u6392\u5e8f\u5217\u3002\u8fd4\u56de\u4e00\u4e2a\u8fed\u4ee3\u5668\uff0c\u6307\u5411\u4e0d\u91cd\u590d\u5143\u7d20\u7684\u5c3e\u540e\u4f4d\u7f6e\nunique_copy_if(beg, end, dest, binaryPred); \/\/ \u901a\u8fc7\u5bf9\u8986\u76d6\u76f8\u90bb\u7684\u91cd\u590d\u5143\u7d20\uff08\u7528 binaryPred \u786e\u5b9a\u662f\u5426\u76f8\u540c\uff09\u5b9e\u73b0\u91cd\u6392\u5e8f\u5217\u3002\u8fd4\u56de\u4e00\u4e2a\u8fed\u4ee3\u5668\uff0c\u6307\u5411\u4e0d\u91cd\u590d\u5143\u7d20\u7684\u5c3e\u540e\u4f4d\u7f6e\nrotate(beg, mid, end); \/\/ \u56f4\u7ed5 mid \u6307\u5411\u7684\u5143\u7d20\u8fdb\u884c\u5143\u7d20\u8f6c\u52a8\u3002\u5143\u7d20 mid \u6210\u4e3a\u4e3a\u9996\u5143\u7d20\uff0c\u968f\u540e\u662f mid+1 \u5230\u5230 end \u4e4b\u524d\u7684\u5143\u7d20\uff0c\u518d\u63a5\u7740\u662f beg \u5230 mid \u4e4b\u524d\u7684\u5143\u7d20\u3002\u8fd4\u56de\u4e00\u4e2a\u8fed\u4ee3\u5668\uff0c\u6307\u5411\u539f\u6765\u5728 beg \u4f4d\u7f6e\u7684\u5143\u7d20\nrotate_copy(beg, mid, end, dest); \/\/ \u56f4\u7ed5 mid \u6307\u5411\u7684\u5143\u7d20\u8fdb\u884c\u5143\u7d20\u8f6c\u52a8\u3002\u5143\u7d20 mid \u6210\u4e3a\u4e3a\u9996\u5143\u7d20\uff0c\u968f\u540e\u662f mid+1 \u5230\u5230 end \u4e4b\u524d\u7684\u5143\u7d20\uff0c\u518d\u63a5\u7740\u662f beg \u5230 mid \u4e4b\u524d\u7684\u5143\u7d20\u3002\u8fd4\u56de\u4e00\u4e2a\u8fed\u4ee3\u5668\uff0c\u6307\u5411\u539f\u6765\u5728 beg \u4f4d\u7f6e\u7684\u5143\u7d20\n<\/code><\/pre>\n<ol class=\"list-paddingleft-1\" style=\"margin-top: 8px; margin-bottom: 8px; padding-left: 25px;\" start=\"11\">\n<li>\n<section style=\"margin-top: 5px; margin-bottom: 5px; line-height: 26px; color: #010101;\">\u4f7f\u7528\u53cc\u5411\u8fed\u4ee3\u5668\u7684\u91cd\u6392\u7b97\u6cd5<\/section>\n<\/li>\n<\/ol>\n<pre style=\"margin-top: 10px; margin-bottom: 10px; border-radius: 5px; box-shadow: rgba(0, 0, 0, 0.55) 0px 2px 10px;\"><code style=\"overflow-x: auto; padding: 16px; color: #abb2bf; display: -webkit-box; font-family: Operator Mono, Consolas, Monaco, Menlo, monospace; font-size: 12px; -webkit-overflow-scrolling: touch; padding-top: 15px; background: #282c34; border-radius: 5px;\">reverse(beg, end); \/\/ \u7ffb\u8f6c\u5e8f\u5217\u4e2d\u7684\u5143\u7d20\uff0c\u8fd4\u56de void\nreverse_copy(beg, end, dest);; \/\/ \u7ffb\u8f6c\u5e8f\u5217\u4e2d\u7684\u5143\u7d20\uff0c\u8fd4\u56de\u4e00\u4e2a\u8fed\u4ee3\u5668\uff0c\u6307\u5411\u62f7\u8d1d\u5230\u76ee\u7684\u5e8f\u5217\u7684\u5143\u7d20\u7684\u5c3e\u540e\u4f4d\u7f6e\n<\/code><\/pre>\n<ol class=\"list-paddingleft-1\" style=\"margin-top: 8px; margin-bottom: 8px; padding-left: 25px;\" start=\"12\">\n<li>\n<section style=\"margin-top: 5px; margin-bottom: 5px; line-height: 26px; color: #010101;\">\u4f7f\u7528\u968f\u673a\u8bbf\u95ee\u8fed\u4ee3\u5668\u7684\u91cd\u6392\u7b97\u6cd5<\/section>\n<\/li>\n<\/ol>\n<pre style=\"margin-top: 10px; margin-bottom: 10px; border-radius: 5px; box-shadow: rgba(0, 0, 0, 0.55) 0px 2px 10px;\"><code style=\"overflow-x: auto; padding: 16px; color: #abb2bf; display: -webkit-box; font-family: Operator Mono, Consolas, Monaco, Menlo, monospace; font-size: 12px; -webkit-overflow-scrolling: touch; padding-top: 15px; background: #282c34; border-radius: 5px;\">random_shuffle(beg, end); \/\/ \u6df7\u6d17\u8f93\u5165\u5e8f\u5217\u4e2d\u7684\u5143\u7d20\uff0c\u8fd4\u56de void\nrandom_shuffle(beg, end, rand); \/\/ \u6df7\u6d17\u8f93\u5165\u5e8f\u5217\u4e2d\u7684\u5143\u7d20\uff0crand \u63a5\u53d7\u4e00\u4e2a\u6b63\u6574\u6570\u7684\u968f\u673a\u5bf9\u8c61\uff0c\u8fd4\u56de void\nshuffle(beg, end, Uniform_rand); \/\/ \u6df7\u6d17\u8f93\u5165\u5e8f\u5217\u4e2d\u7684\u5143\u7d20\uff0cUniform_rand \u5fc5\u987b\u6ee1\u8db3\u5747\u5300\u5206\u5e03\u968f\u673a\u6570\u751f\u6210\u5668\u7684\u8981\u6c42\uff0c\u8fd4\u56de void\n<\/code><\/pre>\n<ol class=\"list-paddingleft-1\" style=\"margin-top: 8px; margin-bottom: 8px; padding-left: 25px;\" start=\"13\">\n<li>\n<section style=\"margin-top: 5px; margin-bottom: 5px; line-height: 26px; color: #010101;\">\u6700\u5c0f\u503c\u548c\u6700\u5927\u503c<\/section>\n<\/li>\n<\/ol>\n<pre style=\"margin-top: 10px; margin-bottom: 10px; border-radius: 5px; box-shadow: rgba(0, 0, 0, 0.55) 0px 2px 10px;\"><code style=\"overflow-x: auto; padding: 16px; color: #abb2bf; display: -webkit-box; font-family: Operator Mono, Consolas, Monaco, Menlo, monospace; font-size: 12px; -webkit-overflow-scrolling: touch; padding-top: 15px; background: #282c34; border-radius: 5px;\">min(val1, va12); \/\/ \u8fd4\u56de val1 \u548c val2 \u4e2d\u7684\u6700\u5c0f\u503c\uff0c\u4e24\u4e2a\u5b9e\u53c2\u7684\u7c7b\u578b\u5fc5\u987b\u5b8c\u5168\u4e00\u81f4\u3002\u53c2\u6570\u548c\u8fd4\u56de\u7c7b\u578b\u90fd\u662f const\u7684\u5f15\u5f15\u7528\uff0c\u610f\u5473\u7740\u5bf9\u8c61\u4e0d\u4f1a\u88ab\u62f7\u8d1d\u3002\u4e0b\u7565\nmin(val1, val2, comp);\nmin(init_list);\nmin(init_list, comp);\nmax(val1, val2);\nmax(val1, val2, comp);\nmax(init_list);\nmax(init_list, comp);\nminmax(val1, val2); \/\/ \u8fd4\u56de\u4e00\u4e2a pair\uff0c\u5176 first \u6210\u5458\u4e3a\u63d0\u4f9b\u7684\u503c\u4e2d\u7684\u8f83\u5c0f\u8005\uff0csecond \u6210\u5458\u4e3a\u8f83\u5927\u8005\u3002\u4e0b\u7565\nminmax(vall, val2, comp);\nminmax(init_list);\nminmax(init_list, comp);\nmin_element(beg, end); \/\/ \u8fd4\u56de\u6307\u5411\u8f93\u5165\u5e8f\u5217\u4e2d\u6700\u5c0f\u5143\u7d20\u7684\u8fed\u4ee3\u5668\nmin_element(beg, end, comp); \/\/ \u8fd4\u56de\u6307\u5411\u8f93\u5165\u5e8f\u5217\u4e2d\u6700\u5c0f\u5143\u7d20\u7684\u8fed\u4ee3\u5668\nmax_element(beg, end); \/\/ \u8fd4\u56de\u6307\u5411\u8f93\u5165\u5e8f\u5217\u4e2d\u6700\u5927\u5143\u7d20\u7684\u8fed\u4ee3\u5668\nmax_element(beg, end, comp); \/\/ \u8fd4\u56de\u6307\u5411\u8f93\u5165\u5e8f\u5217\u4e2d\u6700\u5927\u5143\u7d20\u7684\u8fed\u4ee3\u5668\nminmax_element(beg, end); \/\/ \u8fd4\u56de\u4e00\u4e2a pair\uff0c\u5176\u4e2d first \u6210\u5458\u4e3a\u6700\u5c0f\u5143\u7d20\uff0csecond \u6210\u5458\u4e3a\u6700\u5927\u5143\u7d20\nminmax_element(beg, end, comp); \/\/ \u8fd4\u56de\u4e00\u4e2a pair\uff0c\u5176\u4e2d first \u6210\u5458\u4e3a\u6700\u5c0f\u5143\u7d20\uff0csecond \u6210\u5458\u4e3a\u6700\u5927\u5143\u7d20\n<\/code><\/pre>\n<ol class=\"list-paddingleft-1\" style=\"margin-top: 8px; margin-bottom: 8px; padding-left: 25px;\" start=\"14\">\n<li>\n<section style=\"margin-top: 5px; margin-bottom: 5px; line-height: 26px; color: #010101;\">\u5b57\u5178\u5e8f\u6bd4\u8f83\uff0c\u6839\u636e\u7b2c\u4e00\u5bf9\u4e0d\u76f8\u7b49\u7684\u5143\u7d20\u7684\u76f8\u5bf9\u5927\u5c0f\u6765\u8fd4\u56de\u7ed3\u679c\u3002\u5982\u679c\u7b2c\u4e00\u4e2a\u5e8f\u5217\u5728\u5b57\u5178\u5e8f\u4e2d\u5c0f\u4e8e\u7b2c\u4e8c\u4e2a\u5e8f\u5217\uff0c\u5219\u8fd4\u56de true\u3002\u5426\u5219\uff0c\u8fd4\u56de fa1se\u3002\u5982\u679c\u4e2a\u5e8f\u5217\u6bd4\u53e6\u4e00\u4e2a\u77ed\uff0c\u4e14\u6240\u6709\u5143\u7d20\u90fd\u4e0e\u8f83\u957f\u5e8f\u5217\u7684\u5bf9\u5e94\u5143\u7d20\u76f8\u7b49\uff0c\u5219\u8f83\u77ed\u5e8f\u5217\u5728\u5b57\u5178\u5e8f\u4e2d\u66f4\u5c0f\u3002\u5982\u679c\u5e8f\u5217\u957f\u5ea6\u76f8\u7b49\uff0c\u4e14\u5bf9\u5e94\u5143\u7d20\u90fd\u76f8\u7b49\uff0c\u5219\u5728\u5b57\u5178\u5e8f\u4e2d\u4efb\u4f55\u4e00\u4e2a\u90fd\u4e0d\u5927\u4e8e\u53e6\u5916\u4e00\u4e2a\u3002<\/section>\n<\/li>\n<\/ol>\n<pre style=\"margin-top: 10px; margin-bottom: 10px; border-radius: 5px; box-shadow: rgba(0, 0, 0, 0.55) 0px 2px 10px;\"><code style=\"overflow-x: auto; padding: 16px; color: #abb2bf; display: -webkit-box; font-family: Operator Mono, Consolas, Monaco, Menlo, monospace; font-size: 12px; -webkit-overflow-scrolling: touch; padding-top: 15px; background: #282c34; border-radius: 5px;\">lexicographical_compare(beg1, end1, beg2, end2);\nlexicographical_compare(beg1, end1, beg2, end2, comp);\n<\/code><\/pre>\n<h2 style=\"margin-top: 30px; margin-bottom: 15px; font-weight: bold; border-bottom: 2px solid #ef7060; font-size: 1.3em;\"><span style=\"display: inline-block; background: #ef7060; color: #ffffff; padding: 3px 10px 1px; border-top-right-radius: 3px; border-top-left-radius: 3px; margin-right: 3px;\">5 \u5982\u4f55\u9009\u62e9\u5408\u9002\u7684\u5bb9\u5668<\/span><\/h2>\n<p style=\"padding-top: 8px; padding-bottom: 8px; line-height: 26px;\">\u9700\u8981\u6839\u636e\u5bb9\u5668\u7684\u7279\u70b9\u548c\u4f7f\u7528\u573a\u666f\u800c\u5b9a\uff0c\u53ef\u80fd\u6ee1\u8db3\u9700\u6c42\u7684\u4e0d\u6b62\u4e00\u79cd\u5bb9\u5668\u3002<\/p>\n<p style=\"padding-top: 8px; padding-bottom: 8px; line-height: 26px;\">\u6309\u662f\u5426\u6709\u5e8f\u5173\u8054\u6027\u5206\u4e3a\uff1a<\/p>\n<ol class=\"list-paddingleft-1\" style=\"margin-top: 8px; margin-bottom: 8px; padding-left: 25px;\">\n<li>\n<section style=\"margin-top: 5px; margin-bottom: 5px; line-height: 26px; color: #010101;\">\u5e8f\u5217\u5f0f\u5bb9\u5668\uff1aarray\u3001vector\u3001deque\u3001list \u548c forward_list\uff1b<\/section>\n<\/li>\n<li>\n<section style=\"margin-top: 5px; margin-bottom: 5px; line-height: 26px; color: #010101;\">\u5173\u8054\u5f0f\u5bb9\u5668\uff1amap\u3001multimap\u3001set \u548c multiset\uff1b<\/section>\n<\/li>\n<li>\n<section style=\"margin-top: 5px; margin-bottom: 5px; line-height: 26px; color: #010101;\">\u65e0\u5e8f\u5173\u8054\u5f0f\u5bb9\u5668\uff1aunordered_map\u3001unordered_multimap\u3001unordered_set \u548c unordered_multiset\uff1b<\/section>\n<\/li>\n<li>\n<section style=\"margin-top: 5px; margin-bottom: 5px; line-height: 26px; color: #010101;\">\u5bb9\u5668\u9002\u914d\u5668\uff1astack\u3001queue \u548c priority_queue\u3002 \u6839\u636e\u5bb9\u5668\u5e95\u5c42\u91c7\u7528\u662f\u5426\u662f\u8fde\u7eed\u7684\u5b58\u50a8\u7a7a\u95f4\u5206\u4e3a\uff1a<\/section>\n<\/li>\n<li>\n<section style=\"margin-top: 5px; margin-bottom: 5px; line-height: 26px; color: #010101;\">\u91c7\u7528\u8fde\u7eed\u7684\u5b58\u50a8\u7a7a\u95f4\uff1aarray\u3001vector\u3001deque\uff1b<\/section>\n<\/li>\n<li>\n<section style=\"margin-top: 5px; margin-bottom: 5px; line-height: 26px; color: #010101;\">\u91c7\u7528\u5206\u6563\u7684\u5b58\u50a8\u7a7a\u95f4\uff1alist\u3001forward_list \u4ee5\u53ca\u6240\u6709\u7684\u5173\u8054\u5f0f\u5bb9\u5668\u548c\u54c8\u5e0c\u5bb9\u5668\u3002<\/section>\n<\/li>\n<\/ol>\n<p style=\"padding-top: 8px; padding-bottom: 8px; line-height: 26px;\"><strong>\u6ce8\u610f<\/strong>\uff1adeque \u5bb9\u5668\u5f52\u4e3a\u4f7f\u7528\u8fde\u7eed\u5b58\u50a8\u7a7a\u95f4\u7684\u8fd9\u4e00\u7c7b\uff0c\u662f\u5b58\u5728\u4e89\u8bae\u7684\u3002\u56e0\u4e3a deque \u5bb9\u5668\u5e95\u5c42\u91c7\u7528\u4e00\u6bb5\u4e00\u6bb5\u7684\u8fde\u7eed\u7a7a\u95f4\u5b58\u50a8\u5143\u7d20\uff0c\u4f46\u662f\u5404\u6bb5\u5b58\u50a8\u7a7a\u95f4\u4e4b\u95f4\u5e76\u4e0d\u4e00\u5b9a\u662f\u7d27\u6328\u7740\u7684\u3002<\/p>\n<figure style=\"margin-top: 10px; margin-bottom: 10px;\"><img decoding=\"async\" style=\"display: block; margin-right: auto; margin-left: auto;\" title=\"STL\u603b\u7ed3\u4e0e\u5e38\u89c1\u9762\u8bd5\u9898\" src=\"http:\/\/www.zhushiyao.com\/wp-content\/uploads\/2022\/04\/6-1649301273.png\" alt=\"STL\u603b\u7ed3\u4e0e\u5e38\u89c1\u9762\u8bd5\u9898\" \/><figcaption style=\"margin-top: 5px; text-align: center; color: #888; font-size: 14px;\">\u9009\u62e9\u5bb9\u5668\u6d41\u7a0b\u56fe(\u6765\u6e90\u4e8e\u7f51\u7edc)<\/figcaption><\/figure>\n<p style=\"padding-top: 8px; padding-bottom: 8px; line-height: 26px;\">\u9009\u62e9\u5bb9\u5668\u7684\u51e0\u70b9\u5efa\u8bae\uff1a<\/p>\n<ul class=\"list-paddingleft-1\" style=\"margin-top: 8px; margin-bottom: 8px; padding-left: 25px;\">\n<li>\n<section style=\"margin-top: 5px; margin-bottom: 5px; line-height: 26px; color: #010101;\">\u5982\u679c\u53ea\u662f\u5b58\u50a8\u786e\u5b9a\u6216\u4e0d\u786e\u5b9a\u7684\u5bf9\u8c61\uff0c\u800c\u4e0d\u53bb\u5220\u9664\u5b83\u4eec\uff0c\u53ef\u4ee5\u9009\u7528vector\u3002\u5c31\u662f\u56e0\u4e3avector\u662f\u6570\u7ec4\u7684\u66ff\u4ee3\u54c1\uff0c\u662f\u8fde\u7eed\u5185\u5b58\u7684\uff0c\u4e0d\u9002\u5408\u9891\u7e41\u7684\u5220\u9664\u3002<\/section>\n<\/li>\n<li>\n<section style=\"margin-top: 5px; margin-bottom: 5px; line-height: 26px; color: #010101;\">\u5982\u679c\u5728\u5bb9\u5668\u7684\u6307\u5b9a\u4f4d\u7f6e\u63d2\u5165\u65b0\u5143\u7d20\uff0c\u5219\u53ea\u80fd\u9009\u62e9\u5e8f\u5217\u5f0f\u5bb9\u5668\uff0c\u4e0d\u9009\u62e9\u5173\u8054\u5f0f\u5bb9\u5668\u548c\u54c8\u5e0c\u5bb9\u5668\u3002<\/section>\n<\/li>\n<li>\n<section style=\"margin-top: 5px; margin-bottom: 5px; line-height: 26px; color: #010101;\">\u5982\u679c\u9891\u7e41\u7684\u63d2\u5165\u548c\u5220\u9664\uff0c\u53ef\u4ee5\u9009\u7528list(\u94fe\u8868)\uff0c\u5185\u5b58\u4e0d\u662f\u8fde\u7eed\u7684\uff0c\u53ef\u4ee5\u65b9\u4fbf\u7684\u63d2\u5165\u548c\u5220\u9664\uff0c\u4f46\u662f\u4e0d\u652f\u6301\u7d22\u5f15\u8bbf\u95ee\u3002<\/section>\n<\/li>\n<li>\n<section style=\"margin-top: 5px; margin-bottom: 5px; line-height: 26px; color: #010101;\">\u6570\u636e\u91cf\u5f88\u5927\uff0c\u4e0d\u5728\u4e4e\u4ed6\u4eec\u7684\u6392\u5e8f\uff0c\u8981\u6c42\u6548\u7387\uff0c\u5bf9\u5bb9\u5668\u4e2d\u5404\u5143\u7d20\u7684\u5b58\u50a8\u4f4d\u7f6e\u6ca1\u6709\u8981\u6c42\uff0c\u53ef\u4ee5\u8003\u8651\u4f7f\u7528\u54c8\u5e0c\u5bb9\u5668\uff0c\u53cd\u4e4b\u5c31\u8981\u907f\u514d\u4f7f\u7528\u54c8\u5e0c\u5bb9\u5668\u3002<\/section>\n<\/li>\n<li>\n<section style=\"margin-top: 5px; margin-bottom: 5px; line-height: 26px; color: #010101;\">\u5982\u679c\u662f\u968f\u673a\u8bbf\u95ee\u8fed\u4ee3\u5668\uff0c\u9009\u62e9 array\u3001vector\u3001deque\u3002<\/section>\n<\/li>\n<li>\n<section style=\"margin-top: 5px; margin-bottom: 5px; line-height: 26px; color: #010101;\">\u5982\u679c\u662f\u53cc\u5411\u8fed\u4ee3\u5668\uff0c\u8003\u8651 list \u5e8f\u5217\u5f0f\u5bb9\u5668\u4ee5\u53ca\u6240\u6709\u7684\u5173\u8054\u5f0f\u5bb9\u5668\u3002<\/section>\n<\/li>\n<li>\n<section style=\"margin-top: 5px; margin-bottom: 5px; line-height: 26px; color: #010101;\">\u5982\u679c\u5fc5\u987b\u662f\u524d\u5411\u8fed\u4ee3\u5668\uff0c\u8003\u8651 forward_list\u5e8f\u5217\u5f0f\u5bb9\u5668\u4ee5\u53ca\u6240\u6709\u7684\u54c8\u5e0c\u5bb9\u5668\u3002<\/section>\n<\/li>\n<li>\n<section style=\"margin-top: 5px; margin-bottom: 5px; line-height: 26px; color: #010101;\">\u5982\u679c\u63d2\u5165\u6216\u5220\u9664\u64cd\u4f5c\u65f6\uff0c\u5bb9\u5668\u4e2d\u7684\u5176\u5b83\u5143\u7d20\u4e0d\u79fb\u52a8\uff1f\u9009\u62e9\u4e0d\u662farray\u3001vector\u3001deque\u7684\u5176\u5b83\u5bb9\u5668\u3002<\/section>\n<\/li>\n<\/ul>\n<h2 style=\"margin-top: 30px; margin-bottom: 15px; font-weight: bold; border-bottom: 2px solid #ef7060; font-size: 1.3em;\"><span style=\"display: inline-block; background: #ef7060; color: #ffffff; padding: 3px 10px 1px; border-top-right-radius: 3px; border-top-left-radius: 3px; margin-right: 3px;\">6 \u9762\u8bd5\u4e2d\u5e38\u51fa\u73b0\u7684STL\u95ee\u9898<\/span><\/h2>\n<ol class=\"list-paddingleft-1\" style=\"margin-top: 8px; margin-bottom: 8px; padding-left: 25px;\">\n<li>\n<section style=\"margin-top: 5px; margin-bottom: 5px; line-height: 26px; color: #010101;\">vector\u7684\u5e95\u5c42\u539f\u7406<\/section>\n<\/li>\n<\/ol>\n<p style=\"padding-top: 8px; padding-bottom: 8px; line-height: 26px;\">vector\u5e95\u5c42\u662f\u4e00\u4e2a\u52a8\u6001\u6570\u7ec4\uff0c\u5305\u542b\u4e09\u4e2a\u8fed\u4ee3\u5668\uff0cstart\u548cfinish\u4e4b\u95f4\u662f\u5df2\u7ecf\u88ab\u4f7f\u7528\u7684\u7a7a\u95f4\u8303\u56f4\uff0cend_of_storage\u662f\u6574\u5757\u8fde\u7eed\u7a7a\u95f4\u5305\u62ec\u5907\u7528\u7a7a\u95f4\u7684\u5c3e\u90e8\u3002<\/p>\n<p style=\"padding-top: 8px; padding-bottom: 8px; line-height: 26px;\">\u5f53\u7a7a\u95f4\u4e0d\u591f\u88c5\u4e0b\u6570\u636e\uff08vec.push_back(val)\uff09\u65f6\uff0c\u4f1a\u81ea\u52a8\u7533\u8bf7\u53e6\u4e00\u7247\u66f4\u5927\u7684\u7a7a\u95f4\uff081.5\u500d\u6216\u80052\u500d\uff09\uff0c\u7136\u540e\u628a\u539f\u6765\u7684\u6570\u636e\u62f7\u8d1d\u5230\u65b0\u7684\u5185\u5b58\u7a7a\u95f4\uff0c\u63a5\u7740\u91ca\u653e\u539f\u6765\u7684\u90a3\u7247\u7a7a\u95f4\u3010vector\u5185\u5b58\u589e\u957f\u673a\u5236\u3011\u3002<\/p>\n<p style=\"padding-top: 8px; padding-bottom: 8px; line-height: 26px;\">\u5f53\u91ca\u653e\u6216\u8005\u5220\u9664\uff08vec.clear()\uff09\u91cc\u9762\u7684\u6570\u636e\u65f6\uff0c\u5176\u5b58\u50a8\u7a7a\u95f4\u4e0d\u91ca\u653e\uff0c\u4ec5\u4ec5\u662f\u6e05\u7a7a\u4e86\u91cc\u9762\u7684\u6570\u636e\u3002<\/p>\n<p style=\"padding-top: 8px; padding-bottom: 8px; line-height: 26px;\">\u56e0\u6b64\uff0c\u5bf9vector\u7684\u4efb\u4f55\u64cd\u4f5c\u4e00\u65e6\u5f15\u8d77\u4e86\u7a7a\u95f4\u7684\u91cd\u65b0\u914d\u7f6e\uff0c\u6307\u5411\u539fvector\u7684\u6240\u6709\u8fed\u4ee3\u5668\u4f1a\u90fd\u5931\u6548\u4e86<\/p>\n<figure style=\"margin-top: 10px; margin-bottom: 10px;\"><img decoding=\"async\" style=\"display: block; margin-right: auto; margin-left: auto;\" title=\"STL\u603b\u7ed3\u4e0e\u5e38\u89c1\u9762\u8bd5\u9898\" src=\"http:\/\/www.zhushiyao.com\/wp-content\/uploads\/2022\/04\/5-1649301273.jpeg\" alt=\"STL\u603b\u7ed3\u4e0e\u5e38\u89c1\u9762\u8bd5\u9898\" \/><\/figure>\n<ol class=\"list-paddingleft-1\" style=\"margin-top: 8px; margin-bottom: 8px; padding-left: 25px;\" start=\"2\">\n<li>\n<section style=\"margin-top: 5px; margin-bottom: 5px; line-height: 26px; color: #010101;\">vector\u4e2d\u7684reserve\u548cresize\u7684\u533a\u522b<\/section>\n<\/li>\n<\/ol>\n<ul class=\"list-paddingleft-1\" style=\"margin-top: 8px; margin-bottom: 8px; padding-left: 25px;\">\n<li>\n<section style=\"margin-top: 5px; margin-bottom: 5px; line-height: 26px; color: #010101;\">reserve\u662f\u76f4\u63a5\u6269\u5145\u5230\u5df2\u7ecf\u786e\u5b9a\u7684\u5927\u5c0f\uff0c\u53ef\u4ee5\u51cf\u5c11\u591a\u6b21\u5f00\u8f9f\u3001\u91ca\u653e\u7a7a\u95f4\u7684\u95ee\u9898\uff08\u4f18\u5316push_back\uff09\uff0c\u5c31\u53ef\u4ee5\u63d0\u9ad8\u6548\u7387\uff0c\u5176\u6b21\u8fd8\u53ef\u4ee5\u51cf\u5c11\u591a\u6b21\u8981\u62f7\u8d1d\u6570\u636e\u7684\u95ee\u9898\u3002reserve\u53ea\u662f\u4fdd\u8bc1vector\u4e2d\u7684\u7a7a\u95f4\u5927\u5c0f\uff08capacity\uff09\u6700\u5c11\u8fbe\u5230\u53c2\u6570\u6240\u6307\u5b9a\u7684\u5927\u5c0fn\u3002reserve()\u53ea\u6709\u4e00\u4e2a\u53c2\u6570\u3002<\/section>\n<\/li>\n<li>\n<section style=\"margin-top: 5px; margin-bottom: 5px; line-height: 26px; color: #010101;\">resize()\u53ef\u4ee5\u6539\u53d8\u6709\u6548\u7a7a\u95f4\u7684\u5927\u5c0f\uff0c\u4e5f\u6709\u6539\u53d8\u9ed8\u8ba4\u503c\u7684\u529f\u80fd\u3002capacity\u7684\u5927\u5c0f\u4e5f\u4f1a\u968f\u7740\u6539\u53d8\u3002resize()\u53ef\u4ee5\u6709\u591a\u4e2a\u53c2\u6570\u3002<\/section>\n<\/li>\n<\/ul>\n<ol class=\"list-paddingleft-1\" style=\"margin-top: 8px; margin-bottom: 8px; padding-left: 25px;\" start=\"3\">\n<li>\n<section style=\"margin-top: 5px; margin-bottom: 5px; line-height: 26px; color: #010101;\">vector\u4e2d\u7684size\u548ccapacity\u7684\u533a\u522b<\/section>\n<\/li>\n<\/ol>\n<ul class=\"list-paddingleft-1\" style=\"margin-top: 8px; margin-bottom: 8px; padding-left: 25px;\">\n<li>\n<section style=\"margin-top: 5px; margin-bottom: 5px; line-height: 26px; color: #010101;\">size\u8868\u793a\u5f53\u524dvector\u4e2d\u6709\u591a\u5c11\u4e2a\u5143\u7d20\uff08finish &#8211; start\uff09;<\/section>\n<\/li>\n<li>\n<section style=\"margin-top: 5px; margin-bottom: 5px; line-height: 26px; color: #010101;\">capacity\u51fd\u6570\u5219\u8868\u793a\u5b83\u5df2\u7ecf\u5206\u914d\u7684\u5185\u5b58\u4e2d\u53ef\u4ee5\u5bb9\u7eb3\u591a\u5c11\u5143\u7d20\uff08end_of_storage &#8211; start\uff09;<\/section>\n<\/li>\n<\/ul>\n<ol class=\"list-paddingleft-1\" style=\"margin-top: 8px; margin-bottom: 8px; padding-left: 25px;\" start=\"4\">\n<li>\n<section style=\"margin-top: 5px; margin-bottom: 5px; line-height: 26px; color: #010101;\">vector\u4e2derase\u65b9\u6cd5\u4e0ealgorithn\u4e2d\u7684remove\u65b9\u6cd5\u533a\u522b<\/section>\n<\/li>\n<\/ol>\n<ul class=\"list-paddingleft-1\" style=\"margin-top: 8px; margin-bottom: 8px; padding-left: 25px;\">\n<li>\n<section style=\"margin-top: 5px; margin-bottom: 5px; line-height: 26px; color: #010101;\">vector\u4e2derase\u65b9\u6cd5\u771f\u6b63\u5220\u9664\u4e86\u5143\u7d20\uff0c\u8fed\u4ee3\u5668\u4e0d\u80fd\u8bbf\u95ee\u4e86<\/section>\n<\/li>\n<li>\n<section style=\"margin-top: 5px; margin-bottom: 5px; line-height: 26px; color: #010101;\">remove\u53ea\u662f\u7b80\u5355\u5730\u5c06\u5143\u7d20\u79fb\u5230\u4e86\u5bb9\u5668\u7684\u6700\u540e\u9762\uff0c\u8fed\u4ee3\u5668\u8fd8\u662f\u53ef\u4ee5\u8bbf\u95ee\u5230\u3002\u56e0\u4e3aalgorithm\u901a\u8fc7\u8fed\u4ee3\u5668\u8fdb\u884c\u64cd\u4f5c\uff0c\u4e0d\u77e5\u9053\u5bb9\u5668\u7684\u5185\u90e8\u7ed3\u6784\uff0c\u6240\u4ee5\u65e0\u6cd5\u8fdb\u884c\u771f\u6b63\u7684\u5220\u9664\u3002<\/section>\n<\/li>\n<\/ul>\n<ol class=\"list-paddingleft-1\" style=\"margin-top: 8px; margin-bottom: 8px; padding-left: 25px;\" start=\"5\">\n<li>\n<section style=\"margin-top: 5px; margin-bottom: 5px; line-height: 26px; color: #010101;\">vector\u8fed\u4ee3\u5668\u5931\u6548\u7684\u60c5\u51b5<\/section>\n<\/li>\n<\/ol>\n<ul class=\"list-paddingleft-1\" style=\"margin-top: 8px; margin-bottom: 8px; padding-left: 25px;\">\n<li>\n<section style=\"margin-top: 5px; margin-bottom: 5px; line-height: 26px; color: #010101;\">\u5f53\u63d2\u5165\u4e00\u4e2a\u5143\u7d20\u5230vector\u4e2d\uff0c\u7531\u4e8e\u5f15\u8d77\u4e86\u5185\u5b58\u91cd\u65b0\u5206\u914d\uff0c\u6240\u4ee5\u6307\u5411\u539f\u5185\u5b58\u7684\u8fed\u4ee3\u5668\u5168\u90e8\u5931\u6548\u3002<\/section>\n<\/li>\n<li>\n<section style=\"margin-top: 5px; margin-bottom: 5px; line-height: 26px; color: #010101;\">\u5f53\u5220\u9664\u5bb9\u5668\u4e2d\u4e00\u4e2a\u5143\u7d20\u540e,\u8be5\u8fed\u4ee3\u5668\u6240\u6307\u5411\u7684\u5143\u7d20\u5df2\u7ecf\u88ab\u5220\u9664\uff0c\u90a3\u4e48\u4e5f\u9020\u6210\u8fed\u4ee3\u5668\u5931\u6548\u3002erase\u65b9\u6cd5\u4f1a\u8fd4\u56de\u4e0b\u4e00\u4e2a\u6709\u6548\u7684\u8fed\u4ee3\u5668\uff0c\u6240\u4ee5\u5f53\u6211\u4eec\u8981\u5220\u9664\u67d0\u4e2a\u5143\u7d20\u65f6\uff0c\u9700\u8981<code style=\"font-size: 14px; overflow-wrap: break-word; padding: 2px 4px; border-radius: 4px; margin-right: 2px; margin-left: 2px; background-color: rgba(27, 31, 35, 0.05); font-family: 'Operator Mono', Consolas, Monaco, Menlo, monospace; word-break: break-all; color: #ef7060;\">it=vec.erase(it)<\/code>;\u3002<\/section>\n<\/li>\n<\/ul>\n<ol class=\"list-paddingleft-1\" style=\"margin-top: 8px; margin-bottom: 8px; padding-left: 25px;\" start=\"6\">\n<li>\n<section style=\"margin-top: 5px; margin-bottom: 5px; line-height: 26px; color: #010101;\">\u6b63\u786e\u91ca\u653evector\u7684\u5185\u5b58(clear(), swap(), shrink_to_fit())<\/section>\n<\/li>\n<\/ol>\n<ul class=\"list-paddingleft-1\" style=\"margin-top: 8px; margin-bottom: 8px; padding-left: 25px;\">\n<li>\n<section style=\"margin-top: 5px; margin-bottom: 5px; line-height: 26px; color: #010101;\"><code style=\"font-size: 14px; overflow-wrap: break-word; padding: 2px 4px; border-radius: 4px; margin-right: 2px; margin-left: 2px; background-color: rgba(27, 31, 35, 0.05); font-family: 'Operator Mono', Consolas, Monaco, Menlo, monospace; word-break: break-all; color: #ef7060;\">vec.clear()<\/code>\uff1a\u6e05\u7a7a\u5185\u5bb9\uff0c\u4f46\u662f\u4e0d\u91ca\u653e\u5185\u5b58\u3002<\/section>\n<\/li>\n<li>\n<section style=\"margin-top: 5px; margin-bottom: 5px; line-height: 26px; color: #010101;\"><code style=\"font-size: 14px; overflow-wrap: break-word; padding: 2px 4px; border-radius: 4px; margin-right: 2px; margin-left: 2px; background-color: rgba(27, 31, 35, 0.05); font-family: 'Operator Mono', Consolas, Monaco, Menlo, monospace; word-break: break-all; color: #ef7060;\">vector&lt;int&gt;().swap(vec)<\/code>\uff1a\u6e05\u7a7a\u5185\u5bb9\uff0c\u4e14\u91ca\u653e\u5185\u5b58\uff0c\u60f3\u5f97\u5230\u4e00\u4e2a\u5168\u65b0\u7684vector\u3002<\/section>\n<\/li>\n<li>\n<section style=\"margin-top: 5px; margin-bottom: 5px; line-height: 26px; color: #010101;\"><code style=\"font-size: 14px; overflow-wrap: break-word; padding: 2px 4px; border-radius: 4px; margin-right: 2px; margin-left: 2px; background-color: rgba(27, 31, 35, 0.05); font-family: 'Operator Mono', Consolas, Monaco, Menlo, monospace; word-break: break-all; color: #ef7060;\">vec.shrink_to_fit()<\/code>\uff1a\u8bf7\u6c42\u5bb9\u5668\u964d\u4f4e\u5176capacity\u548csize\u5339\u914d\u3002<\/section>\n<\/li>\n<li>\n<section style=\"margin-top: 5px; margin-bottom: 5px; line-height: 26px; color: #010101;\"><code style=\"font-size: 14px; overflow-wrap: break-word; padding: 2px 4px; border-radius: 4px; margin-right: 2px; margin-left: 2px; background-color: rgba(27, 31, 35, 0.05); font-family: 'Operator Mono', Consolas, Monaco, Menlo, monospace; word-break: break-all; color: #ef7060;\">vec.clear();vec.shrink_to_fit()<\/code>;\uff1a\u6e05\u7a7a\u5185\u5bb9\uff0c\u4e14\u91ca\u653e\u5185\u5b58\u3002<\/section>\n<\/li>\n<\/ul>\n<ol class=\"list-paddingleft-1\" style=\"margin-top: 8px; margin-bottom: 8px; padding-left: 25px;\" start=\"7\">\n<li>\n<section style=\"margin-top: 5px; margin-bottom: 5px; line-height: 26px; color: #010101;\">list\u7684\u5e95\u5c42\u539f\u7406<\/section>\n<\/li>\n<\/ol>\n<figure style=\"margin-top: 10px; margin-bottom: 10px;\"><img decoding=\"async\" style=\"display: block; margin-right: auto; margin-left: auto;\" title=\"STL\u603b\u7ed3\u4e0e\u5e38\u89c1\u9762\u8bd5\u9898\" src=\"http:\/\/www.zhushiyao.com\/wp-content\/uploads\/2022\/04\/9-1649301273.jpeg\" alt=\"STL\u603b\u7ed3\u4e0e\u5e38\u89c1\u9762\u8bd5\u9898\" \/><\/figure>\n<ul class=\"list-paddingleft-1\" style=\"margin-top: 8px; margin-bottom: 8px; padding-left: 25px;\">\n<li>\n<section style=\"margin-top: 5px; margin-bottom: 5px; line-height: 26px; color: #010101;\">ist\u7684\u5e95\u5c42\u662f\u4e00\u4e2a\u53cc\u5411\u94fe\u8868\uff0c\u4f7f\u7528\u94fe\u8868\u5b58\u50a8\u6570\u636e\uff0c\u5e76\u4e0d\u4f1a\u5c06\u5b83\u4eec\u5b58\u50a8\u5230\u4e00\u6574\u5757\u8fde\u7eed\u7684\u5185\u5b58\u7a7a\u95f4\u4e2d\u3002\u6070\u6070\u76f8\u53cd\uff0c\u5404\u5143\u7d20\u5360\u7528\u7684\u5b58\u50a8\u7a7a\u95f4\uff08\u53c8\u79f0\u4e3a\u8282\u70b9\uff09\u662f\u72ec\u7acb\u7684\u3001\u5206\u6563\u7684\uff0c\u5b83\u4eec\u4e4b\u95f4\u7684\u7ebf\u6027\u5173\u7cfb\u901a\u8fc7\u6307\u9488\u6765\u7ef4\u6301,\u6bcf\u6b21\u63d2\u5165\u6216\u5220\u9664\u4e00\u4e2a\u5143\u7d20\uff0c\u5c31\u914d\u7f6e\u6216\u91ca\u653e\u4e00\u4e2a\u5143\u7d20\u7a7a\u95f4\u3002<\/section>\n<\/li>\n<li>\n<section style=\"margin-top: 5px; margin-bottom: 5px; line-height: 26px; color: #010101;\">list\u4e0d\u652f\u6301\u968f\u673a\u5b58\u53d6\uff0c\u5982\u679c\u9700\u8981\u5927\u91cf\u7684\u63d2\u5165\u548c\u5220\u9664\uff0c\u800c\u4e0d\u5173\u5fc3\u968f\u5373\u5b58\u53d6<\/section>\n<\/li>\n<\/ul>\n<ol class=\"list-paddingleft-1\" style=\"margin-top: 8px; margin-bottom: 8px; padding-left: 25px;\" start=\"8\">\n<li>\n<section style=\"margin-top: 5px; margin-bottom: 5px; line-height: 26px; color: #010101;\">\u4ec0\u4e48\u60c5\u51b5\u4e0b\u7528vector\uff0c\u4ec0\u4e48\u60c5\u51b5\u4e0b\u7528list\uff0c\u4ec0\u4e48\u60c5\u51b5\u4e0b\u7528deque<\/section>\n<\/li>\n<\/ol>\n<ul class=\"list-paddingleft-1\" style=\"margin-top: 8px; margin-bottom: 8px; padding-left: 25px;\">\n<li>\n<section style=\"margin-top: 5px; margin-bottom: 5px; line-height: 26px; color: #010101;\">vector\u53ef\u4ee5\u968f\u673a\u5b58\u50a8\u5143\u7d20\uff08\u5373\u53ef\u4ee5\u901a\u8fc7\u516c\u5f0f\u76f4\u63a5\u8ba1\u7b97\u51fa\u5143\u7d20\u5730\u5740\uff0c\u800c\u4e0d\u9700\u8981\u6328\u4e2a\u67e5\u627e\uff09\uff0c\u4f46\u5728\u975e\u5c3e\u90e8\u63d2\u5165\u5220\u9664\u6570\u636e\u65f6\uff0c\u6548\u7387\u5f88\u4f4e\uff0c\u9002\u5408\u5bf9\u8c61\u7b80\u5355\uff0c\u5bf9\u8c61\u6570\u91cf\u53d8\u5316\u4e0d\u5927\uff0c\u968f\u673a\u8bbf\u95ee\u9891\u7e41\u3002\u9664\u975e\u5fc5\u8981\uff0c\u6211\u4eec\u5c3d\u53ef\u80fd\u9009\u62e9\u4f7f\u7528vector\u800c\u975edeque\uff0c\u56e0\u4e3adeque\u7684\u8fed\u4ee3\u5668\u6bd4vector\u8fed\u4ee3\u5668\u590d\u6742\u5f88\u591a\u3002<\/section>\n<\/li>\n<li>\n<section style=\"margin-top: 5px; margin-bottom: 5px; line-height: 26px; color: #010101;\">list\u4e0d\u652f\u6301\u968f\u673a\u5b58\u50a8\uff0c\u9002\u7528\u4e8e\u5bf9\u8c61\u5927\uff0c\u5bf9\u8c61\u6570\u91cf\u53d8\u5316\u9891\u7e41\uff0c\u63d2\u5165\u548c\u5220\u9664\u9891\u7e41\uff0c\u6bd4\u5982\u5199\u591a\u8bfb\u5c11\u7684\u573a\u666f\u3002<\/section>\n<\/li>\n<li>\n<section style=\"margin-top: 5px; margin-bottom: 5px; line-height: 26px; color: #010101;\">\u9700\u8981\u4ece\u9996\u5c3e\u4e24\u7aef\u8fdb\u884c\u63d2\u5165\u6216\u5220\u9664\u64cd\u4f5c\u7684\u65f6\u5019\u9700\u8981\u9009\u62e9deque\u3002<\/section>\n<\/li>\n<\/ul>\n<ol class=\"list-paddingleft-1\" style=\"margin-top: 8px; margin-bottom: 8px; padding-left: 25px;\" start=\"9\">\n<li>\n<section style=\"margin-top: 5px; margin-bottom: 5px; line-height: 26px; color: #010101;\">priority_queue\u7684\u5e95\u5c42\u539f\u7406<\/section>\n<\/li>\n<\/ol>\n<ul class=\"list-paddingleft-1\" style=\"margin-top: 8px; margin-bottom: 8px; padding-left: 25px;\">\n<li>\n<section style=\"margin-top: 5px; margin-bottom: 5px; line-height: 26px; color: #010101;\">priority_queue\uff1a\u4f18\u5148\u961f\u5217\uff0c\u5176\u5e95\u5c42\u662f\u7528\u5806\u6765\u5b9e\u73b0\u7684\u3002\u5728\u4f18\u5148\u961f\u5217\u4e2d\uff0c\u961f\u9996\u5143\u7d20\u4e00\u5b9a\u662f\u5f53\u524d\u961f\u5217\u4e2d\u4f18\u5148\u7ea7\u6700\u9ad8\u7684\u90a3\u4e00\u4e2a\u3002<\/section>\n<\/li>\n<\/ul>\n<ol class=\"list-paddingleft-1\" style=\"margin-top: 8px; margin-bottom: 8px; padding-left: 25px;\" start=\"10\">\n<li>\n<section style=\"margin-top: 5px; margin-bottom: 5px; line-height: 26px; color: #010101;\">map \u3001set\u3001multiset\u3001multimap\u7684\u5e95\u5c42\u539f\u7406<\/section>\n<\/li>\n<\/ol>\n<p style=\"padding-top: 8px; padding-bottom: 8px; line-height: 26px;\">map \u3001set\u3001multiset\u3001multimap\u7684\u5e95\u5c42\u5b9e\u73b0\u90fd\u662f\u7ea2\u9ed1\u6811\uff0cepoll\u6a21\u578b\u7684\u5e95\u5c42\u6570\u636e\u7ed3\u6784\u4e5f\u662f\u7ea2\u9ed1\u6811\uff0clinux\u7cfb\u7edf\u4e2dCFS\u8fdb\u7a0b\u8c03\u5ea6\u7b97\u6cd5\uff0c\u4e5f\u7528\u5230\u7ea2\u9ed1\u6811\u3002<\/p>\n<figure style=\"margin-top: 10px; margin-bottom: 10px;\"><img decoding=\"async\" style=\"display: block; margin-right: auto; margin-left: auto;\" title=\"STL\u603b\u7ed3\u4e0e\u5e38\u89c1\u9762\u8bd5\u9898\" src=\"http:\/\/www.zhushiyao.com\/wp-content\/uploads\/2022\/04\/6-1649301273.jpeg\" alt=\"STL\u603b\u7ed3\u4e0e\u5e38\u89c1\u9762\u8bd5\u9898\" \/><\/figure>\n<p style=\"padding-top: 8px; padding-bottom: 8px; line-height: 26px;\">\u7ea2\u9ed1\u6811\u7684\u7279\u6027\uff1a<\/p>\n<ul class=\"list-paddingleft-1\" style=\"margin-top: 8px; margin-bottom: 8px; padding-left: 25px;\">\n<li>\n<section style=\"margin-top: 5px; margin-bottom: 5px; line-height: 26px; color: #010101;\">\u6bcf\u4e2a\u7ed3\u70b9\u6216\u662f\u7ea2\u8272\u6216\u662f\u9ed1\u8272\uff1b<\/section>\n<\/li>\n<li>\n<section style=\"margin-top: 5px; margin-bottom: 5px; line-height: 26px; color: #010101;\">\u6839\u7ed3\u70b9\u662f\u9ed1\u8272\uff1b<\/section>\n<\/li>\n<li>\n<section style=\"margin-top: 5px; margin-bottom: 5px; line-height: 26px; color: #010101;\">\u6bcf\u4e2a\u53f6\u7ed3\u70b9\u662f\u9ed1\u7684\uff1b<\/section>\n<\/li>\n<li>\n<section style=\"margin-top: 5px; margin-bottom: 5px; line-height: 26px; color: #010101;\">\u5982\u679c\u4e00\u4e2a\u7ed3\u70b9\u662f\u7ea2\u7684\uff0c\u5219\u5b83\u7684\u4e24\u4e2a\u513f\u5b50\u5747\u662f\u9ed1\u8272\uff1b<\/section>\n<\/li>\n<li>\n<section style=\"margin-top: 5px; margin-bottom: 5px; line-height: 26px; color: #010101;\">\u6bcf\u4e2a\u7ed3\u70b9\u5230\u5176\u5b50\u5b59\u7ed3\u70b9\u7684\u6240\u6709\u8def\u5f84\u4e0a\u5305\u542b\u76f8\u540c\u6570\u76ee\u7684\u9ed1\u8272\u7ed3\u70b9\u3002<\/section>\n<\/li>\n<\/ul>\n<ol class=\"list-paddingleft-1\" style=\"margin-top: 8px; margin-bottom: 8px; padding-left: 25px;\" start=\"11\">\n<li>\n<section style=\"margin-top: 5px; margin-bottom: 5px; line-height: 26px; color: #010101;\">\u4e3a\u4f55map\u548cset\u7684\u63d2\u5165\u5220\u9664\u6548\u7387\u6bd4\u5176\u4ed6\u5e8f\u5217\u5bb9\u5668\u9ad8<\/section>\n<\/li>\n<\/ol>\n<ul class=\"list-paddingleft-1\" style=\"margin-top: 8px; margin-bottom: 8px; padding-left: 25px;\">\n<li>\n<section style=\"margin-top: 5px; margin-bottom: 5px; line-height: 26px; color: #010101;\">\u56e0\u4e3a\u4e0d\u9700\u8981\u5185\u5b58\u62f7\u8d1d\u548c\u5185\u5b58\u79fb\u52a8<\/section>\n<\/li>\n<\/ul>\n<ol class=\"list-paddingleft-1\" style=\"margin-top: 8px; margin-bottom: 8px; padding-left: 25px;\" start=\"12\">\n<li>\n<section style=\"margin-top: 5px; margin-bottom: 5px; line-height: 26px; color: #010101;\">\u4e3a\u4f55map\u548cset\u6bcf\u6b21Insert\u4e4b\u540e\uff0c\u4ee5\u524d\u4fdd\u5b58\u7684iterator\u4e0d\u4f1a\u5931\u6548\uff1f<\/section>\n<\/li>\n<\/ol>\n<ul class=\"list-paddingleft-1\" style=\"margin-top: 8px; margin-bottom: 8px; padding-left: 25px;\">\n<li>\n<section style=\"margin-top: 5px; margin-bottom: 5px; line-height: 26px; color: #010101;\">\u56e0\u4e3a\u63d2\u5165\u64cd\u4f5c\u53ea\u662f\u7ed3\u70b9\u6307\u9488\u6362\u6765\u6362\u53bb\uff0c\u7ed3\u70b9\u5185\u5b58\u6ca1\u6709\u6539\u53d8\u3002\u800citerator\u5c31\u50cf\u6307\u5411\u7ed3\u70b9\u7684\u6307\u9488\uff0c\u5185\u5b58\u6ca1\u53d8\uff0c\u6307\u5411\u5185\u5b58\u7684\u6307\u9488\u4e5f\u4e0d\u4f1a\u53d8\u3002<\/section>\n<\/li>\n<\/ul>\n<ol class=\"list-paddingleft-1\" style=\"margin-top: 8px; margin-bottom: 8px; padding-left: 25px;\" start=\"13\">\n<li>\n<section style=\"margin-top: 5px; margin-bottom: 5px; line-height: 26px; color: #010101;\">\u5f53\u6570\u636e\u5143\u7d20\u589e\u591a\u65f6\uff08\u4ece10000\u523020000\uff09\uff0cmap\u7684set\u7684\u67e5\u627e\u901f\u5ea6\u4f1a\u600e\u6837\u53d8\u5316\uff1f<\/section>\n<\/li>\n<\/ol>\n<ul class=\"list-paddingleft-1\" style=\"margin-top: 8px; margin-bottom: 8px; padding-left: 25px;\">\n<li>\n<section style=\"margin-top: 5px; margin-bottom: 5px; line-height: 26px; color: #010101;\">RB-TREE\u7528\u4e8c\u5206\u67e5\u627e\u6cd5\uff0c\u65f6\u95f4\u590d\u6742\u5ea6\u4e3alogn\uff0c\u6240\u4ee5\u4ece10000\u589e\u523020000\u65f6\uff0c\u67e5\u627e\u6b21\u6570\u4ecelog10000=14\u6b21\u5230log20000=15\u6b21\uff0c\u591a\u4e861\u6b21\u800c\u5df2\u3002<\/section>\n<\/li>\n<\/ul>\n<ol class=\"list-paddingleft-1\" style=\"margin-top: 8px; margin-bottom: 8px; padding-left: 25px;\" start=\"14\">\n<li>\n<section style=\"margin-top: 5px; margin-bottom: 5px; line-height: 26px; color: #010101;\">map \u3001set\u3001multiset\u3001multimap\u7684\u7279\u70b9<\/section>\n<\/li>\n<\/ol>\n<ul class=\"list-paddingleft-1\" style=\"margin-top: 8px; margin-bottom: 8px; padding-left: 25px;\">\n<li>\n<section style=\"margin-top: 5px; margin-bottom: 5px; line-height: 26px; color: #010101;\">set\u548cmultiset\u4f1a\u6839\u636e\u7279\u5b9a\u7684\u6392\u5e8f\u51c6\u5219\u81ea\u52a8\u5c06\u5143\u7d20\u6392\u5e8f\uff0cset\u4e2d\u5143\u7d20\u4e0d\u5141\u8bb8\u91cd\u590d\uff0cmultiset\u53ef\u4ee5\u91cd\u590d\u3002<\/section>\n<\/li>\n<li>\n<section style=\"margin-top: 5px; margin-bottom: 5px; line-height: 26px; color: #010101;\">map\u548cmultimap\u5c06key\u548cvalue\u7ec4\u6210\u7684pair\u4f5c\u4e3a\u5143\u7d20\uff0c\u6839\u636ekey\u7684\u6392\u5e8f\u51c6\u5219\u81ea\u52a8\u5c06\u5143\u7d20\u6392\u5e8f\uff08\u56e0\u4e3a\u7ea2\u9ed1\u6811\u4e5f\u662f\u4e8c\u53c9\u641c\u7d22\u6811\uff0c\u6240\u4ee5map\u9ed8\u8ba4\u662f\u6309key\u6392\u5e8f\u7684\uff09\uff0cmap\u4e2d\u5143\u7d20\u7684key\u4e0d\u5141\u8bb8\u91cd\u590d\uff0cmultimap\u53ef\u4ee5\u91cd\u590d\u3002<\/section>\n<\/li>\n<li>\n<section style=\"margin-top: 5px; margin-bottom: 5px; line-height: 26px; color: #010101;\">map\u548cset\u7684\u589e\u5220\u6539\u67e5\u901f\u5ea6\u4e3a\u90fd\u662flogn\uff0c\u662f\u6bd4\u8f83\u9ad8\u6548\u7684\u3002<\/section>\n<\/li>\n<\/ul>\n<ol class=\"list-paddingleft-1\" style=\"margin-top: 8px; margin-bottom: 8px; padding-left: 25px;\" start=\"15\">\n<li>\n<section style=\"margin-top: 5px; margin-bottom: 5px; line-height: 26px; color: #010101;\">\u4e3a\u4f55map\u548cset\u7684\u63d2\u5165\u5220\u9664\u6548\u7387\u6bd4\u5176\u4ed6\u5e8f\u5217\u5bb9\u5668\u9ad8\uff0c\u800c\u4e14\u6bcf\u6b21insert\u4e4b\u540e\uff0c\u4ee5\u524d\u4fdd\u5b58\u7684iterator\u4e0d\u4f1a\u5931\u6548\uff1f<\/section>\n<\/li>\n<\/ol>\n<ul class=\"list-paddingleft-1\" style=\"margin-top: 8px; margin-bottom: 8px; padding-left: 25px;\">\n<li>\n<section style=\"margin-top: 5px; margin-bottom: 5px; line-height: 26px; color: #010101;\">\u5b58\u50a8\u7684\u662f\u7ed3\u70b9\uff0c\u4e0d\u9700\u8981\u5185\u5b58\u62f7\u8d1d\u548c\u5185\u5b58\u79fb\u52a8\u3002<\/section>\n<\/li>\n<li>\n<section style=\"margin-top: 5px; margin-bottom: 5px; line-height: 26px; color: #010101;\">\u63d2\u5165\u64cd\u4f5c\u53ea\u662f\u7ed3\u70b9\u6307\u9488\u6362\u6765\u6362\u53bb\uff0c\u7ed3\u70b9\u5185\u5b58\u6ca1\u6709\u6539\u53d8\u3002\u800citerator\u5c31\u50cf\u6307\u5411\u7ed3\u70b9\u7684\u6307\u9488\uff0c\u5185\u5b58\u6ca1\u53d8\uff0c\u6307\u5411\u5185\u5b58\u7684\u6307\u9488\u4e5f\u4e0d\u4f1a\u53d8\u3002<\/section>\n<\/li>\n<\/ul>\n<ol class=\"list-paddingleft-1\" style=\"margin-top: 8px; margin-bottom: 8px; padding-left: 25px;\" start=\"16\">\n<li>\n<section style=\"margin-top: 5px; margin-bottom: 5px; line-height: 26px; color: #010101;\">\u4e3a\u4f55map\u548cset\u4e0d\u80fd\u50cfvector\u4e00\u6837\u6709\u4e2areserve\u51fd\u6570\u6765\u9884\u5206\u914d\u6570\u636e?<\/section>\n<\/li>\n<\/ol>\n<ul class=\"list-paddingleft-1\" style=\"margin-top: 8px; margin-bottom: 8px; padding-left: 25px;\">\n<li>\n<section style=\"margin-top: 5px; margin-bottom: 5px; line-height: 26px; color: #010101;\">\u5728map\u548cset\u5185\u90e8\u5b58\u50a8\u7684\u5df2\u7ecf\u4e0d\u662f\u5143\u7d20\u672c\u8eab\u4e86\uff0c\u800c\u662f\u5305\u542b\u5143\u7d20\u7684\u7ed3\u70b9\u3002\u4e5f\u5c31\u662f\u8bf4map\u5185\u90e8\u4f7f\u7528\u7684Alloc\u5e76\u4e0d\u662fmap&lt;Key, Data, Compare, Alloc&gt;\u58f0\u660e\u7684\u65f6\u5019\u4ece\u53c2\u6570\u4e2d\u4f20\u5165\u7684Alloc\u3002<\/section>\n<\/li>\n<\/ul>\n<ol class=\"list-paddingleft-1\" style=\"margin-top: 8px; margin-bottom: 8px; padding-left: 25px;\" start=\"17\">\n<li>\n<section style=\"margin-top: 5px; margin-bottom: 5px; line-height: 26px; color: #010101;\">set\u7684\u5e95\u5c42\u5b9e\u73b0\u5b9e\u73b0\u4e3a\u4ec0\u4e48\u4e0d\u7528\u54c8\u5e0c\u8868\u800c\u4f7f\u7528\u7ea2\u9ed1\u6811\uff1f<\/section>\n<\/li>\n<\/ol>\n<ul class=\"list-paddingleft-1\" style=\"margin-top: 8px; margin-bottom: 8px; padding-left: 25px;\">\n<li>\n<section style=\"margin-top: 5px; margin-bottom: 5px; line-height: 26px; color: #010101;\">set\u4e2d\u5143\u7d20\u662f\u7ecf\u8fc7\u6392\u5e8f\u7684\uff0c\u7ea2\u9ed1\u6811\u4e5f\u662f\u6709\u5e8f\u7684\uff0c\u54c8\u5e0c\u662f\u65e0\u5e8f\u7684<\/section>\n<\/li>\n<li>\n<section style=\"margin-top: 5px; margin-bottom: 5px; line-height: 26px; color: #010101;\">\u5982\u679c\u53ea\u662f\u5355\u7eaf\u7684\u67e5\u627e\u5143\u7d20\u7684\u8bdd\uff0c\u90a3\u4e48\u80af\u5b9a\u8981\u9009\u54c8\u5e0c\u8868\u4e86\uff0c\u56e0\u4e3a\u54c8\u5e0c\u8868\u5728\u7684\u6700\u597d\u67e5\u627e\u65f6\u95f4\u590d\u6742\u5ea6\u4e3aO(1)\uff0c\u5e76\u4e14\u5982\u679c\u7528\u5230set\u4e2d\u90a3\u4e48\u67e5\u627e\u65f6\u95f4\u590d\u6742\u5ea6\u7684\u4e00\u76f4\u662fO\uff081\uff09\uff0c\u56e0\u4e3aset\u4e2d\u662f\u4e0d\u5141\u8bb8\u6709\u5143\u7d20\u91cd\u590d\u7684\u3002\u800c\u7ea2\u9ed1\u6811\u7684\u67e5\u627e\u65f6\u95f4\u590d\u6742\u5ea6\u4e3aO(lgn)<\/section>\n<\/li>\n<\/ul>\n<ol class=\"list-paddingleft-1\" style=\"margin-top: 8px; margin-bottom: 8px; padding-left: 25px;\" start=\"18\">\n<li>\n<section style=\"margin-top: 5px; margin-bottom: 5px; line-height: 26px; color: #010101;\">hash_map\u4e0emap\u7684\u533a\u522b\uff1f\u4ec0\u4e48\u65f6\u5019\u7528hash_map\uff0c\u4ec0\u4e48\u65f6\u5019\u7528map\uff1f \u6784\u9020\u51fd\u6570\uff1ahash_map\u9700\u8981hash function\u548c\u7b49\u4e8e\u51fd\u6570\uff0c\u800cmap\u9700\u8981\u6bd4\u8f83\u51fd\u6570\uff08\u5927\u4e8e\u6216\u5c0f\u4e8e\uff09\u3002<\/section>\n<\/li>\n<\/ol>\n<p style=\"padding-top: 8px; padding-bottom: 8px; line-height: 26px;\">\u5b58\u50a8\u7ed3\u6784\uff1ahash_map\u4ee5hashtable\u4e3a\u5e95\u5c42\uff0c\u800cmap\u4ee5RB-TREE\u4e3a\u5e95\u5c42\u3002<\/p>\n<p style=\"padding-top: 8px; padding-bottom: 8px; line-height: 26px;\">\u603b\u7684\u8bf4\u6765\uff0chash_map\u67e5\u627e\u901f\u5ea6\u6bd4map\u5feb\uff0c\u800c\u4e14\u67e5\u627e\u901f\u5ea6\u57fa\u672c\u548c\u6570\u636e\u91cf\u5927\u5c0f\u65e0\u5173\uff0c\u5c5e\u4e8e\u5e38\u6570\u7ea7\u522b\u3002\u800cmap\u7684\u67e5\u627e\u901f\u5ea6\u662flogn\u7ea7\u522b\u3002\u4f46\u4e0d\u4e00\u5b9a\u5e38\u6570\u5c31\u6bd4log\u5c0f\uff0c\u800c\u4e14hash_map\u8fd8\u6709hash function\u8017\u65f6\u3002<\/p>\n<p style=\"padding-top: 8px; padding-bottom: 8px; line-height: 26px;\">\u5982\u679c\u8003\u8651\u6548\u7387\uff0c\u7279\u522b\u5f53\u5143\u7d20\u8fbe\u5230\u4e00\u5b9a\u6570\u91cf\u7ea7\u65f6\uff0c\u7528hash_map\u3002<\/p>\n<p style=\"padding-top: 8px; padding-bottom: 8px; line-height: 26px;\">\u8003\u8651\u5185\u5b58\uff0c\u6216\u8005\u5143\u7d20\u6570\u91cf\u8f83\u5c11\u65f6\uff0c\u7528map\u3002<\/p>\n<ol class=\"list-paddingleft-1\" style=\"margin-top: 8px; margin-bottom: 8px; padding-left: 25px;\" start=\"19\">\n<li>\n<section style=\"margin-top: 5px; margin-bottom: 5px; line-height: 26px; color: #010101;\">\u8fed\u4ee3\u5668\u5931\u6548\u7684\u95ee\u9898<\/section>\n<\/li>\n<\/ol>\n<p style=\"padding-top: 8px; padding-bottom: 8px; line-height: 26px;\">\u63d2\u5165\u64cd\u4f5c\uff1a<\/p>\n<ul class=\"list-paddingleft-1\" style=\"margin-top: 8px; margin-bottom: 8px; padding-left: 25px;\">\n<li>\n<section style=\"margin-top: 5px; margin-bottom: 5px; line-height: 26px; color: #010101;\">\u5bf9\u4e8evector\u548cstring\uff0c\u5982\u679c\u5bb9\u5668\u5185\u5b58\u88ab\u91cd\u65b0\u5206\u914d\uff0citerators,pointers,references\u5931\u6548\uff1b\u5982\u679c\u6ca1\u6709\u91cd\u65b0\u5206\u914d\uff0c\u90a3\u4e48\u63d2\u5165\u70b9\u4e4b\u524d\u7684iterator\u6709\u6548\uff0c\u63d2\u5165\u70b9\u4e4b\u540e\u7684iterator\u5931\u6548\uff1b<\/section>\n<\/li>\n<li>\n<section style=\"margin-top: 5px; margin-bottom: 5px; line-height: 26px; color: #010101;\">\u5bf9\u4e8edeque\uff0c\u5982\u679c\u63d2\u5165\u70b9\u4f4d\u4e8e\u9664front\u548cback\u7684\u5176\u5b83\u4f4d\u7f6e\uff0citerators,pointers,references\u5931\u6548\uff1b\u5f53\u6211\u4eec\u63d2\u5165\u5143\u7d20\u5230front\u548cback\u65f6\uff0cdeque\u7684\u8fed\u4ee3\u5668\u5931\u6548\uff0c\u4f46reference\u548cpointers\u6709\u6548\uff1b<\/section>\n<\/li>\n<li>\n<section style=\"margin-top: 5px; margin-bottom: 5px; line-height: 26px; color: #010101;\">\u5bf9\u4e8elist\u548cforward_list\uff0c\u6240\u6709\u7684iterator,pointer\u548crefercnce\u6709\u6548\u3002<\/section>\n<\/li>\n<\/ul>\n<p style=\"padding-top: 8px; padding-bottom: 8px; line-height: 26px;\">\u5220\u9664\u64cd\u4f5c\uff1a<\/p>\n<ul class=\"list-paddingleft-1\" style=\"margin-top: 8px; margin-bottom: 8px; padding-left: 25px;\">\n<li>\n<section style=\"margin-top: 5px; margin-bottom: 5px; line-height: 26px; color: #010101;\">\u5bf9\u4e8evector\u548cstring\uff0c\u5220\u9664\u70b9\u4e4b\u524d\u7684iterators,pointers,references\u6709\u6548\uff1boff-the-end\u8fed\u4ee3\u5668\u603b\u662f\u5931\u6548\u7684\uff1b<\/section>\n<\/li>\n<li>\n<section style=\"margin-top: 5px; margin-bottom: 5px; line-height: 26px; color: #010101;\">\u5bf9\u4e8edeque\uff0c\u5982\u679c\u5220\u9664\u70b9\u4f4d\u4e8e\u9664front\u548cback\u7684\u5176\u5b83\u4f4d\u7f6e\uff0citerators,pointers,references\u5931\u6548\uff1b\u5f53\u6211\u4eec\u63d2\u5165\u5143\u7d20\u5230front\u548cback\u65f6\uff0coff-the-end\u5931\u6548\uff0c\u5176\u4ed6\u7684iterators,pointers,references\u6709\u6548\uff1b<\/section>\n<\/li>\n<li>\n<section style=\"margin-top: 5px; margin-bottom: 5px; line-height: 26px; color: #010101;\">\u5bf9\u4e8elist\u548cforward_list\uff0c\u6240\u6709\u7684iterator,pointer\u548crefercnce\u6709\u6548\u3002<\/section>\n<\/li>\n<li>\n<section style=\"margin-top: 5px; margin-bottom: 5px; line-height: 26px; color: #010101;\">\u5bf9\u4e8e\u5173\u8054\u5bb9\u5668map\u6765\u8bf4\uff0c\u5982\u679c\u67d0\u4e00\u4e2a\u5143\u7d20\u5df2\u7ecf\u88ab\u5220\u9664\uff0c\u90a3\u4e48\u5176\u5bf9\u5e94\u7684\u8fed\u4ee3\u5668\u5c31\u5931\u6548\u4e86\uff0c\u4e0d\u5e94\u8be5\u518d\u88ab\u4f7f\u7528\uff0c\u5426\u5219\u4f1a\u5bfc\u81f4\u7a0b\u5e8f\u65e0\u5b9a\u4e49\u7684\u884c\u4e3a\u3002<\/section>\n<\/li>\n<\/ul>\n<ol class=\"list-paddingleft-1\" style=\"margin-top: 8px; margin-bottom: 8px; padding-left: 25px;\" start=\"20\">\n<li>\n<section style=\"margin-top: 5px; margin-bottom: 5px; line-height: 26px; color: #010101;\">\u7ebf\u7a0b\u4e0d\u5b89\u5168\u7684\u60c5\u51b5<\/section>\n<\/li>\n<\/ol>\n<ul class=\"list-paddingleft-1\" style=\"margin-top: 8px; margin-bottom: 8px; padding-left: 25px;\">\n<li>\n<section style=\"margin-top: 5px; margin-bottom: 5px; line-height: 26px; color: #010101;\">\u5728\u5bf9\u540c\u4e00\u4e2a\u5bb9\u5668\u8fdb\u884c\u591a\u7ebf\u7a0b\u7684\u8bfb\u5199\u3001\u5199\u64cd\u4f5c\u65f6\uff1b<\/section>\n<\/li>\n<li>\n<section style=\"margin-top: 5px; margin-bottom: 5px; line-height: 26px; color: #010101;\">\u5728\u6bcf\u6b21\u8c03\u7528\u5bb9\u5668\u7684\u6210\u5458\u51fd\u6570\u671f\u95f4\u90fd\u8981\u9501\u5b9a\u8be5\u5bb9\u5668\uff1b<\/section>\n<\/li>\n<li>\n<section style=\"margin-top: 5px; margin-bottom: 5px; line-height: 26px; color: #010101;\">\u5728\u6bcf\u4e2a\u5bb9\u5668\u8fd4\u56de\u7684\u8fed\u4ee3\u5668\uff08\u4f8b\u5982\u901a\u8fc7\u8c03\u7528begin\u6216end\uff09\u7684\u751f\u5b58\u671f\u4e4b\u5185\u90fd\u8981\u9501\u5b9a\u8be5\u5bb9\u5668\uff1b<\/section>\n<\/li>\n<li>\n<section style=\"margin-top: 5px; margin-bottom: 5px; line-height: 26px; color: #010101;\">\u5728\u6bcf\u4e2a\u5728\u5bb9\u5668\u4e0a\u8c03\u7528\u7684\u7b97\u6cd5\u6267\u884c\u671f\u95f4\u9501\u5b9a\u8be5\u5bb9\u5668\u3002<\/section>\n<\/li>\n<\/ul>\n<h2 style=\"margin-top: 30px; margin-bottom: 15px; font-weight: bold; border-bottom: 2px solid #ef7060; font-size: 1.3em;\"><span style=\"display: inline-block; background: #ef7060; color: #ffffff; padding: 3px 10px 1px; border-top-right-radius: 3px; border-top-left-radius: 3px; margin-right: 3px;\">\u53c2\u8003\u8d44\u6599<\/span><\/h2>\n<p style=\"padding-top: 8px; padding-bottom: 8px; line-height: 26px;\">http:\/\/www.cplusplus.com\/reference\/stl\/ https:\/\/blog.csdn.net\/qq_23350817\/article\/details\/87930715 https:\/\/blog.csdn.net\/bizhu12\/article\/details\/6769976 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 http:\/\/c.biancheng.net\/view\/7385.html<br \/>\nhttps:\/\/blog.csdn.net\/daaikuaichuan\/article\/details\/80717222<\/p>\n<section class=\"mp_profile_iframe_wrp\"><\/section>\n<\/section>\n<p>\u8f6c\u81ea\uff1ahttps:\/\/mp.weixin.qq.com\/s\/JWAestcpQTlp2fb1Q45AQg<\/p>\n<\/div>\n","protected":false},"excerpt":{"rendered":"<p>1 STL\u6982\u8ff0 \u4e3a\u4e86\u5efa\u7acb\u6570\u636e\u7ed3\u6784\u548c\u7b97\u6cd5\u7684\u4e00\u5957\u6807\u51c6\uff0c\u5e76\u4e14\u964d\u4f4e\u4ed6\u4eec\u4e4b\u95f4\u7684\u8026\u5408\u5173\u7cfb\uff0c\u4ee5\u63d0\u5347\u5404\u81ea\u7684\u72ec\u7acb\u6027\u3001\u5f39\u6027\u3001\u4ea4\u4e92\u64cd &hellip; <a href=\"http:\/\/www.zhushiyao.com\/?p=100697\" class=\"more-link\">\u7ee7\u7eed\u9605\u8bfb<span class=\"screen-reader-text\">\u201cSTL\u603b\u7ed3\u4e0e\u5e38\u89c1\u9762\u8bd5\u9898\u201d<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":[],"categories":[2],"tags":[899],"_links":{"self":[{"href":"http:\/\/www.zhushiyao.com\/index.php?rest_route=\/wp\/v2\/posts\/100697"}],"collection":[{"href":"http:\/\/www.zhushiyao.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/www.zhushiyao.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/www.zhushiyao.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/www.zhushiyao.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=100697"}],"version-history":[{"count":2,"href":"http:\/\/www.zhushiyao.com\/index.php?rest_route=\/wp\/v2\/posts\/100697\/revisions"}],"predecessor-version":[{"id":100714,"href":"http:\/\/www.zhushiyao.com\/index.php?rest_route=\/wp\/v2\/posts\/100697\/revisions\/100714"}],"wp:attachment":[{"href":"http:\/\/www.zhushiyao.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=100697"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/www.zhushiyao.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=100697"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/www.zhushiyao.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=100697"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}