{"id":102811,"date":"2026-09-09T14:25:22","date_gmt":"2026-09-09T06:25:22","guid":{"rendered":"https:\/\/www.wsisp.com\/helps\/102811.html"},"modified":"2026-09-09T14:25:22","modified_gmt":"2026-09-09T06:25:22","slug":"%e6%95%b0%e6%8d%ae%e7%bb%93%e6%9e%84%e4%b8%8e%e7%ae%97%e6%b3%95-%e7%ac%ac-2-%e7%ab%a0-%e5%b8%b8%e7%94%a8%e6%95%b0%e6%8d%ae%e7%bb%93%e6%9e%84","status":"publish","type":"post","link":"https:\/\/www.wsisp.com\/helps\/102811.html","title":{"rendered":"\u6570\u636e\u7ed3\u6784\u4e0e\u7b97\u6cd5- \u7b2c 2 \u7ae0 \u5e38\u7528\u6570\u636e\u7ed3\u6784"},"content":{"rendered":"<h2>\u7b2c 2 \u7ae0 \u5e38\u7528\u6570\u636e\u7ed3\u6784<\/h2>\n<p>\u62bd\u8c61\u6570\u636e\u7c7b\u578b&#xff08;Abstract Data Type&#xff0c;\u7b80\u79f0 ADT&#xff09;\u662f\u8ba1\u7b97\u673a\u79d1\u5b66\u4e2d\u4e00\u4e2a\u91cd\u8981\u7684\u6982\u5ff5&#xff0c;\u5b83\u662f\u5bf9\u6570\u636e\u7684\u4e00\u79cd\u62bd\u8c61\u63cf\u8ff0&#xff0c;\u5173\u6ce8\u6570\u636e\u7684\u903b\u8f91\u7279\u6027\u548c\u64cd\u4f5c&#xff0c;\u800c\u4e0d\u6d89\u53ca\u5177\u4f53\u7684\u5b9e\u73b0\u7ec6\u8282\u3002<\/p>\n<p>\u62bd\u8c61\u6570\u636e\u7c7b\u578b\u901a\u5e38\u7531\u4ee5\u4e0b\u4e24\u90e8\u5206\u7ec4\u6210&#xff1a;<\/p>\n<ul>\n<li>\n<p>\u6570\u636e\u5bf9\u8c61&#xff1a;\u63cf\u8ff0\u4e86\u8be5\u6570\u636e\u7c7b\u578b\u6240\u5305\u542b\u7684\u6570\u636e\u5143\u7d20\u4ee5\u53ca\u5b83\u4eec\u4e4b\u95f4\u7684\u903b\u8f91\u5173\u7cfb\u3002\u4f8b\u5982&#xff0c;\u5728\u4e00\u4e2a\u6808\u7684\u62bd\u8c61\u6570\u636e\u7c7b\u578b\u4e2d&#xff0c;\u6570\u636e\u5bf9\u8c61\u662f\u4e00\u7cfb\u5217\u6309\u540e\u8fdb\u5148\u51fa&#xff08;LIFO&#xff09;\u539f\u5219\u7ec4\u7ec7\u7684\u5143\u7d20\u3002<\/p>\n<\/li>\n<li>\n<p>\u64cd\u4f5c\u96c6\u5408&#xff1a;\u5b9a\u4e49\u4e86\u5bf9\u6570\u636e\u5bf9\u8c61\u53ef\u4ee5\u6267\u884c\u7684\u64cd\u4f5c\u3002\u5bf9\u4e8e\u6808\u6765\u8bf4&#xff0c;\u5e38\u89c1\u7684\u64cd\u4f5c\u5305\u62ec\u5165\u6808&#xff08;push&#xff09;\u3001\u51fa\u6808&#xff08;pop&#xff09;\u3001\u67e5\u770b\u6808\u9876\u5143\u7d20&#xff08;peek&#xff09;\u7b49\u3002<\/p>\n<\/li>\n<\/ul>\n<p>\u62bd\u8c61\u6570\u636e\u7c7b\u578b\u4e0e\u6570\u636e\u7ed3\u6784\u7684\u5173\u7cfb<\/p>\n<ul>\n<li>\n<p>\u62bd\u8c61\u6570\u636e\u7c7b\u578b&#xff1a;\u5f3a\u8c03\u7684\u662f\u6570\u636e\u7684\u903b\u8f91\u7279\u6027\u548c\u64cd\u4f5c\u7684\u529f\u80fd&#xff0c;\u662f\u4e00\u79cd\u62bd\u8c61\u7684\u6982\u5ff5&#xff0c;\u4e0d\u6d89\u53ca\u5177\u4f53\u7684\u5b9e\u73b0\u7ec6\u8282\u3002\u5b83\u662f\u4ece\u7528\u6237\u7684\u89d2\u5ea6\u6765\u63cf\u8ff0\u6570\u636e\u548c\u64cd\u4f5c\u7684\u3002<\/p>\n<\/li>\n<li>\n<p>\u6570\u636e\u7ed3\u6784&#xff1a;\u662f\u62bd\u8c61\u6570\u636e\u7c7b\u578b\u7684\u5177\u4f53\u5b9e\u73b0&#xff0c;\u5b83\u5173\u6ce8\u7684\u662f\u6570\u636e\u5728\u8ba1\u7b97\u673a\u5185\u5b58\u4e2d\u7684\u5b58\u50a8\u65b9\u5f0f\u548c\u64cd\u4f5c\u7684\u5177\u4f53\u5b9e\u73b0\u7b97\u6cd5\u3002\u4f8b\u5982&#xff0c;\u6808\u8fd9\u79cd\u62bd\u8c61\u6570\u636e\u7c7b\u578b\u53ef\u4ee5\u7528\u6570\u7ec4\u6216\u94fe\u8868\u7b49\u6570\u636e\u7ed3\u6784\u6765\u5b9e\u73b0\u3002<\/p>\n<\/li>\n<\/ul>\n<h3>2.1 \u6570\u7ec4<\/h3>\n<h4>2.1.1 \u6570\u7ec4\u7684\u6982\u8ff0<\/h4>\n<p>\u6570\u7ec4\u662f\u4e00\u79cd\u7ebf\u6027\u6570\u636e\u7ed3\u6784&#xff0c;\u5c06\u76f8\u540c\u7c7b\u578b\u7684\u5143\u7d20\u987a\u5e8f\u5730\u5b58\u50a8\u5728\u8fde\u7eed\u7684\u5185\u5b58\u7a7a\u95f4\u4e2d&#xff0c;\u6bcf\u4e2a\u5143\u7d20\u90fd\u6709\u4e00\u4e2a\u7d22\u5f15\u3002<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2026\/09\/20260909062518-6aa0fbce46d08.png\" alt=\"\u5728\u8fd9\u91cc\u63d2\u5165\u56fe\u7247\u63cf\u8ff0\" \/><\/p>\n<p>\u7531\u4e8e\u6570\u7ec4\u5143\u7d20\u5728\u5185\u5b58\u4e2d\u662f\u8fde\u7eed\u5b58\u50a8\u7684&#xff0c;\u6240\u4ee5\u53ea\u8981\u77e5\u9053\u6570\u7ec4\u7684\u8d77\u59cb\u4f4d\u7f6e&#xff0c;\u4ee5\u53ca\u6570\u7ec4\u5143\u7d20\u7684\u7c7b\u578b&#xff08;\u5355\u4e2a\u5143\u7d20\u7684\u957f\u5ea6&#xff09;&#xff0c;\u5c31\u53ef\u4ee5\u6839\u636e\u7d22\u5f15\u8ba1\u7b97\u51fa\u4efb\u610f\u5143\u7d20\u7684\u4f4d\u7f6e\u3002<\/p>\n<p>\u6570\u7ec4\u5728\u521b\u5efa\u65f6\u9700\u8981\u6307\u5b9a\u957f\u5ea6&#xff0c;\u5e76\u4e14\u6570\u7ec4\u4e00\u65e6\u521b\u5efa&#xff0c;\u957f\u5ea6\u5c31\u65e0\u6cd5\u6539\u53d8&#xff0c;\u5982\u679c\u9700\u8981\u6269\u5bb9&#xff0c;\u53ea\u80fd\u521b\u5efa\u4e00\u4e2a\u66f4\u5927\u7684\u6570\u7ec4&#xff0c;\u518d\u5c06\u539f\u6570\u636e\u62f7\u8d1d\u5230\u65b0\u6570\u7ec4\u3002\u5e76\u4e14\u7531\u4e8e\u6570\u7ec4\u7684\u8fde\u7eed\u6027&#xff0c;\u63d2\u5165\u548c\u5220\u9664\u6570\u636e\u53ef\u80fd\u9700\u8981\u79fb\u52a8\u5176\u4ed6\u5143\u7d20\u3002<\/p>\n<p>\u5728 Python \u4e2d&#xff0c;\u5e76\u6ca1\u6709\u50cf\u5176\u4ed6\u4e00\u4e9b\u7f16\u7a0b\u8bed\u8a00&#xff08;\u5982 C\u3001Java&#xff09;\u90a3\u6837\u4e25\u683c\u610f\u4e49\u4e0a\u7684 \u201c\u6570\u7ec4\u201d \u6982\u5ff5&#xff0c;\u4f46\u6709\u591a\u79cd\u6570\u636e\u7ed3\u6784\u53ef\u4ee5\u7528\u6765\u6a21\u62df\u6570\u7ec4\u7684\u529f\u80fd&#xff0c;\u6700\u5e38\u7528\u7684\u662f\u5217\u8868&#xff08;list&#xff09;&#xff0c;\u53e6\u5916\u8fd8\u6709 array \u6a21\u5757\u7684\u6570\u7ec4\u548c numpy \u5e93\u7684 ndarray\u3002<\/p>\n<p>\u901a\u8fc7Python \u7684list\u5217\u8868\u5b9e\u73b0\u4e00\u4e2a\u52a8\u6001\u6570\u7ec4&#xff0c;\u5b83\u5185\u90e8\u5b58\u50a8\u7684\u5b9e\u9645\u4e0a\u662f\u5bf9\u8c61\u7684\u5f15\u7528&#xff08;\u6307\u9488&#xff09;&#xff0c;\u800c\u4e0d\u662f\u5bf9\u8c61\u672c\u8eab\u3002\u6bcf\u4e2a\u5f15\u7528\u6307\u5411\u5185\u5b58\u4e2d\u5b58\u50a8\u5b9e\u9645\u5bf9\u8c61\u7684\u4f4d\u7f6e\u3002<\/p>\n<p>\u4ec0\u4e48\u662f\u6570\u7ec4<\/p>\n<li>\n<p>\u7528\u6765\u5b58\u50a8\u76f8\u540c\u6570\u636e\u7c7b\u578b\u7684\u6570\u636e\u7ed3\u6784<\/p>\n<\/li>\n<li>\n<p>\u6570\u7ec4\u662f\u6709\u5e8f\u7684&#xff0c;\u53ef\u4ee5\u901a\u8fc7\u4e0b\u6807\u83b7\u53d6\u5143\u7d20<\/p>\n<\/li>\n<li>\n<p>\u6570\u7ec4\u5728\u5185\u5b58\u4e2d\u4f1a\u5206\u914d\u4e00\u7247\u8fde\u7eed\u7684\u5b58\u50a8\u7a7a\u95f4<\/p>\n<\/li>\n<li>\n<p>\u6570\u7ec4\u5728\u521b\u5efa\u65f6\u9700\u8981\u6307\u5b9a\u957f\u5ea6&#xff0c;\u5e76\u4e14\u6570\u7ec4\u4e00\u65e6\u521b\u5efa&#xff0c;\u957f\u5ea6\u5c31\u65e0\u6cd5\u6539\u53d8&#xff0c;\u5982\u679c\u9700\u8981\u6269\u5bb9&#xff0c;\u53ea\u80fd\u521b\u5efa\u4e00\u4e2a\u66f4\u5927\u7684\u6570\u7ec4&#xff0c;\u518d\u5c06\u539f\u6570\u636e\u62f7\u8d1d\u5230\u65b0\u6570\u7ec4<\/p>\n<\/li>\n<p>\u4f46\u662f python\u4e2d\u6ca1\u6709\u6570\u7ec4&#xff0c;\u5982\u679c\u60f3\u4f7f\u7528\u6570\u7ec4&#xff0c;\u53ef\u4ee5\u4f7f\u7528array.array()\u6216\u8005numpy\u6a21\u5757\u7684ndarray,\u800carray.array\u662f\u652f\u6301\u52a8\u6001\u6269\u5bb9\u7684<\/p>\n<p>\u4e0b\u9762\u662f\u4e00\u4e2a\u4f8b\u5b50&#xff1a;<\/p>\n<p>import array<\/p>\n<p>list1 &#061; [1,2,3,&#034;hello&#034;]<br \/>\nprint(list1)<\/p>\n<p># \u9700\u8981\u662f\u76f8\u540c\u6570\u636e\u7c7b\u578b<br \/>\narr &#061; array.array(&#034;i&#034;,[1,2,3])<br \/>\nprint(arr)<\/p>\n<p>num &#061; 1<br \/>\nprint(id(num))      # 140719834157992<br \/>\nprint(id(arr[0]))   # 140719834157992<\/p>\n<p>\u8fd9\u4e2a\u662flist\u7684\u521b\u5efa\u903b\u8f91&#xff1a;<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2026\/09\/20260909062518-6aa0fbce59306.png\" alt=\"\u5728\u8fd9\u91cc\u63d2\u5165\u56fe\u7247\u63cf\u8ff0\" \/><\/p>\n<p>array.array\u4f7f\u7528\u6570\u7ec4\u903b\u8f91&#xff1a;<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2026\/09\/20260909062518-6aa0fbce92e8c.png\" alt=\"\u5728\u8fd9\u91cc\u63d2\u5165\u56fe\u7247\u63cf\u8ff0\" \/><\/p>\n<p>\u4f1a\u53d1\u73b0 \u548clist\u6709\u533a\u522b&#xff1a;<\/p>\n<ul>\n<li>\n<p>array.array\u4e2d\u56e0\u4e3a\u8981\u6c42\u76f8\u540c\u6570\u636e\u7c7b\u578b&#xff0c;\u4e0d\u80fd\u6307\u5411 hello\u7684\u5730\u5740<\/p>\n<\/li>\n<li>\n<p>array.array\u521b\u5efa\u7684\u5bf9\u8c61\u4e2d\u5b58\u50a8\u7684\u4e0d\u662f\u5730\u5740&#xff0c;\u800c\u662f\u5177\u4f53\u7684\u503c\/\u4e8c\u8fdb\u5236\u6570<\/p>\n<\/li>\n<li>\n<p>print(id(num)) \u548c print(arr[0])\u7684\u5730\u5740\u76f8\u540c<\/p>\n<\/li>\n<\/ul>\n<p>\u56e0\u4e3a\u5982\u679c\u6307\u5b9a\u7684\u662f i \u7684\u8bdd&#xff0c;\u5982\u4e0b\u56fe,\u5982\u679c\u5b58\u50a8\u503c\u53ea\u9700\u89812\u4e2a\u5b57\u8282\u7a7a\u95f4\u5927\u5c0f\u5c31\u53ef\u4ee5&#xff0c;\u4f46\u5982\u679c\u662f\u5b58\u50a8\u5730\u5740\u5c31\u9700\u89818\u4e2a\u7a7a\u95f4&#xff0c;\u6539\u4e3a\u5b58\u50a8\u503c \u66f4\u8282\u7701\u7a7a\u95f4\u3002<\/p>\n<p>\u800c\u5728\u83b7\u53d6\u5730\u5740\u7684\u65f6\u5019&#xff0c;\u5b83\u4e0d\u4f1a\u76f4\u63a5\u628a\u503c\u7ed9\u4f60&#xff0c;\u800c\u662f\u9700\u8981\u8fdb\u884c \u521b\u5efa\u5bf9\u8c61&#xff0c;\u800c\u5728\u521b\u5efa\u5bf9\u8c61\u7684\u65f6\u5019\u5b83\u53d1\u73b0 \u5c0f\u6574\u6570\u6c60\u4e2d\u5df2\u7ecf\u5b58\u5728&#xff0c;\u56e0\u6b64\u5c31\u4e0d\u8fdb\u884c\u521b\u5efa\u4e86&#xff0c;\u800c\u662f\u76f4\u63a5\u62ff\u8fc7\u6765\u4f7f\u7528&#xff0c;\u6240\u4ee5\u4e24\u4e2a\u6253\u5370\u7684\u7ed3\u679c\u4e00\u6837<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2026\/09\/20260909062518-6aa0fbced08cb.png\" alt=\"\u5728\u8fd9\u91cc\u63d2\u5165\u56fe\u7247\u63cf\u8ff0\" \/><\/p>\n<h4>2.1.2 \u987a\u5e8f\u8868<\/h4>\n<p>\u6211\u4eec\u6839\u636e\u6570\u7ec4\u7684\u6982\u8ff0\u5f97\u77e5&#xff1a; Python\u8bed\u8a00\u4e2d\u7684list\u3001array\u90fd\u662f\u52a8\u6001&#xff0c;\u4e0d\u9700\u8981\u5173\u6ce8\u6269\u5bb9\u7684\u8fc7\u7a0b&#xff0c;\u800c\u5728\u4e00\u4e9b\u5176\u4ed6\u7f16\u7a0b\u8bed\u8a00\u4e2d&#xff0c;\u6bd4\u5982C\u3001java\u4e2d\u7684\u6570\u7ec4\u662f\u9700\u8981\u624b\u52a8\u6269\u5bb9\u7684&#xff0c; \u5b83\u4eec\u7684\u5e95\u5c42\u90fd\u662f\u987a\u5e8f\u8868 &#xff0c;\u53ea\u4e0d\u8fc7\u662f\u4e0d\u540c\u7684\u5b58\u50a8\u65b9\u5f0f<\/p>\n<p>\u987a\u5e8f\u8868\u5305\u542b&#xff1a;<\/p>\n<ul>\n<li>\n<p>\u4e00\u4f53\u5f0f\u5b58\u50a8&#xff08;\u5982C\u3001java\u4e2d\u7684\u6570\u7ec4&#xff0c;Python\u4e2d\u7684\u5143\u7ec4&#xff09;<\/p>\n<\/li>\n<li>\n<p>\u5206\u79bb\u5f0f\u5b58\u50a8 &#xff08;\u5982Python\u4e2d\u7684list\u3001array.array&#xff0c;java\u7684ArrayList)<\/p>\n<\/li>\n<\/ul>\n<p>\u4e00\u4f53\u5f0f\u5b58\u50a8&#xff1a;<\/p>\n<p>\u521b\u5efa\u7684\u5bf9\u8c61\u4e2d\u4fe1\u606f\u5305\u542b&#xff1a;\u7c7b\u578b\u3001\u4e2a\u6570\u3001\u5bb9\u91cf\u3001\u5177\u4f53\u5143\u7d20\u3002 \u5f53\u6269\u5bb9\u7684\u65f6\u5019&#xff0c;\u4f1a\u521b\u5efa\u65b0\u7684\u5bf9\u8c61&#xff0c;\u5e76\u6307\u5411\u5b83\u7684\u5730\u5740<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2026\/09\/20260909062518-6aa0fbcee89e7.png\" alt=\"\u5728\u8fd9\u91cc\u63d2\u5165\u56fe\u7247\u63cf\u8ff0\" \/><\/p>\n<p>\u5206\u79bb\u5f0f\u5b58\u50a8&#xff1a;<\/p>\n<p>\u5206\u79bb\u5f0f\u5b58\u50a8\u4f1a\u53d1\u73b0\u4ecd\u65e7\u521b\u5efa\u4e86\u5bf9\u8c61&#xff0c;\u4f46list\u4e2d\u5b58\u50a8\u7684\u662f\u6570\u636e\u7684\u5730\u5740&#xff0c;\u5f53\u9700\u8981\u6269\u5bb9\u7684\u65f6\u5019&#xff0c;\u4e5f\u8fdb\u884c\u4e86\u65b0\u7684\u6570\u636e\u5bf9\u8c61\u7684\u521b\u5efa&#xff0c;\u4f46list\u5185\u90e8\u53ea\u662f\u66f4\u6539\u4e86\u5b58\u50a8\u6570\u636e \u7684\u5730\u5740&#xff0c;list\u672c\u8eab\u5e76\u6ca1\u6709\u6269\u5bb9<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2026\/09\/20260909062519-6aa0fbcf18b4f.png\" alt=\"\u5728\u8fd9\u91cc\u63d2\u5165\u56fe\u7247\u63cf\u8ff0\" \/><\/p>\n<h4>2.1.3 \u6570\u7ec4\u7684\u529f\u80fd\u5b9a\u4e49<\/h4>\n<table>\n<tr>\u65b9\u6cd5\u8bf4\u660e<\/tr>\n<tbody>\n<tr>\n<td>size()<\/td>\n<td>\u8fd4\u56de\u6570\u7ec4\u4e2d\u5143\u7d20\u4e2a\u6570<\/td>\n<\/tr>\n<tr>\n<td>is_empty()<\/td>\n<td>\u5224\u65ad\u6570\u7ec4\u662f\u5426\u4e3a\u7a7a<\/td>\n<\/tr>\n<tr>\n<td>insert(index, item)<\/td>\n<td>\u5728\u6307\u5b9a\u4f4d\u7f6e\u63d2\u5165\u5143\u7d20<\/td>\n<\/tr>\n<tr>\n<td>append(item)<\/td>\n<td>\u5728\u672b\u5c3e\u63d2\u5165\u5143\u7d20<\/td>\n<\/tr>\n<tr>\n<td>remove(index)<\/td>\n<td>\u5220\u9664\u6307\u5b9a\u4f4d\u7f6e\u7684\u5143\u7d20<\/td>\n<\/tr>\n<tr>\n<td>set(index, item)<\/td>\n<td>\u4fee\u6539\u6307\u5b9a\u4f4d\u7f6e\u7684\u5143\u7d20<\/td>\n<\/tr>\n<tr>\n<td>get(index)<\/td>\n<td>\u83b7\u53d6\u6307\u5b9a\u4f4d\u7f6e\u7684\u5143\u7d20<\/td>\n<\/tr>\n<tr>\n<td>find(item)<\/td>\n<td>\u67e5\u627e\u6570\u7ec4\u4e2d\u67d0\u4e2a\u5143\u7d20\u7684\u4f4d\u7f6e<\/td>\n<\/tr>\n<tr>\n<td>for_each(func)<\/td>\n<td>\u904d\u5386\u6570\u7ec4<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<h4>2.1.4 \u6570\u7ec4\u7684\u521b\u5efa<\/h4>\n<p>\u5b9e\u73b0\u4e00\u4e2a\u52a8\u6001\u6570\u7ec4\u3002<\/p>\n<p>class Array:<br \/>\n    def __init__(self):<br \/>\n        *&#034;&#034;&#034;\u521d\u59cb\u5316\u6570\u7ec4&#034;&#034;&#034;*<br \/>\n*        *# \u6570\u7ec4\u7684\u521d\u59cb\u5316\u5bb9\u91cf<br \/>\n        self.__capacity &#061; 7<br \/>\n        # \u6570\u7ec4\u4e2d\u5143\u7d20\u7684\u4e2a\u6570<br \/>\n        self.__size &#061; 0<br \/>\n        # \u771f\u6b63\u5b58\u50a8\u6570\u636e\u7684\u5bf9\u8c61&#xff0c; \u521b\u5efa\u4e86\u4e00\u4e2a\u5168\u662f0\u7684\u6570\u7ec4<br \/>\n        self.__items &#061; [0] * 7<\/p>\n<p>    def __str__(self):<br \/>\n        *&#034;&#034;&#034;\u6253\u5370\u6570\u7ec4&#034;&#034;&#034;*<br \/>\n*        *arr_str &#061; &#034;[&#034;<br \/>\n        for i in range(self.__size):<br \/>\n            arr_str &#043;&#061; str(self.__items[i])<br \/>\n            if i &lt; self.__size &#8211; 1:<br \/>\n                arr_str &#043;&#061; &#034;, &#034;<br \/>\n        arr_str &#043;&#061; &#034;]&#034;<br \/>\n        return arr_str<\/p>\n<p>    # \u65b9\u6cd5\u8f6c\u4e3a\u5c5e\u6027<br \/>\n    &#064;property<br \/>\n    def size(self):<br \/>\n        *&#034;&#034;&#034;\u83b7\u53d6\u6570\u7ec4\u5143\u7d20\u4e2a\u6570&#034;&#034;&#034;*<br \/>\n*        *return self.__size<\/p>\n<p>    def is_empty(self):<br \/>\n        *&#034;&#034;&#034;\u5224\u65ad\u6570\u7ec4\u662f\u5426\u4e3a\u7a7a&#034;&#034;&#034;*<br \/>\n*        *return self.__size &#061;&#061; 0<\/p>\n<h4>2.1.5 \u6570\u7ec4\u6269\u5bb9<\/h4>\n<p>\u5f53\u6570\u7ec4\u5bb9\u91cf\u5360\u6ee1\u540e&#xff0c;\u6211\u4eec\u53ef\u4ee5\u521b\u5efa\u4e00\u4e2a\u65b0\u7684\u6570\u7ec4&#xff0c;\u5bb9\u91cf\u4e3a\u4e4b\u524d\u6570\u7ec4\u76842\u500d&#xff0c;\u5e76\u5c06\u4e4b\u524d\u6570\u7ec4\u7684\u5143\u7d20\u62f7\u8d1d\u5230\u65b0\u6570\u7ec4\u4e2d\u3002<\/p>\n<p>def __grow(self):<br \/>\n    *&#034;&#034;&#034;\u6570\u7ec4\u6269\u5bb9&#034;&#034;&#034;*<br \/>\n*    *# \u521b\u5efa\u65b0\u7684\u6570\u636e  \u5bb9\u91cf\u662f\u539f\u6765\u76842\u500d<br \/>\n    self.__capacity *&#061; 8<br \/>\n    new___items &#061; [0] * self.__capacity<\/p>\n<p>    # \u5c06\u8001\u6570\u7ec4\u6570\u636e \u590d\u5236\u5230\u65b0\u7684\u6570\u7ec4\u4e2d<br \/>\n    for i in range(self.__size):<br \/>\n        new___items[i] &#061; self.__items[i]<\/p>\n<p>    # \u5c06\u6570\u7ec4\u5b58\u50a8\u6570\u636e\u7684\u5bf9\u8c61\u5730\u5740 \u6307\u5411\u65b0\u7684\u6570\u7ec4<br \/>\n    self.__items &#061; new___items<\/p>\n<h4>2.1.6 \u6dfb\u52a0\/\u63d2\u5165\u5143\u7d20<\/h4>\n<p>\u5728\u4e2d\u95f4\u63d2\u5165\u5143\u7d20\u65f6&#xff0c;\u5c06\u6307\u5b9a\u4f4d\u7f6e\u53ca\u5176\u4e4b\u540e\u7684\u5143\u7d20\u5168\u90e8\u5411\u540e\u79fb\u52a8\u4e00\u4e2a\u4f4d\u7f6e&#xff0c;\u5e76\u5c06\u6307\u5b9a\u4f4d\u7f6e\u6539\u4e3a\u65b0\u7684\u5143\u7d20\u3002<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2026\/09\/20260909062519-6aa0fbcf41cee.png\" alt=\"\u5728\u8fd9\u91cc\u63d2\u5165\u56fe\u7247\u63cf\u8ff0\" \/><\/p>\n<p>\u5982\u679c\u76f4\u63a5\u4ece\u524d\u8fb9\u5411\u540e\u79fb\u52a8,\u7d22\u5f15\u4f1a\u6df7\u4e71,\u56e0\u6b64**\u4ece\u540e\u8fb9\u5411\u524d\u8fb9\u904d\u5386, **\u4ee5\u4e0a\u8ff0 \u6570\u7ec4\u521b\u5efa\u4e3a\u4f8b,\u90a3\u4e48\u5e94\u8be5\u4ece\u7d22\u5f155\u7684\u4f4d\u7f6e\u904d\u5386,\u5230\u7d22\u5f153<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2026\/09\/20260909062519-6aa0fbcf5320d.png\" alt=\"\u5728\u8fd9\u91cc\u63d2\u5165\u56fe\u7247\u63cf\u8ff0\" \/><\/p>\n<p>#\u6dfb\u52a0\u5143\u7d20<br \/>\ndef insert(self,index,item):<br \/>\n    if index &lt; 0  or index &gt; self.__size:<br \/>\n        raise IndexError(&#034;index out of range&#034;)<\/p>\n<p>    # \u5224\u65ad\u662f\u5426\u9700\u8981\u6269\u5bb9<br \/>\n    if self.__size &#061;&#061; self.__capacity:<br \/>\n        self.__grow()<\/p>\n<p>    for i in range(self.__size,index,-1):<br \/>\n        self.__items[i] &#061; self.__items[i-1]<\/p>\n<p>    self.__items[index] &#061; item<\/p>\n<p>    self.__size &#043;&#061; 1<\/p>\n<p># \u5411\u6570\u7ec4\u4e2d\u8ffd\u52a0\u5143\u7d20<br \/>\ndef append(self,item):<br \/>\n    self.insert(self.__size,item)<\/p>\n<h4>2.1.7 \u5220\u9664\u5143\u7d20<\/h4>\n<p>\u5220\u9664\u6570\u7ec4\u4e2d\u6307\u5b9a\u4f4d\u7f6e\u7684\u5143\u7d20\u65f6&#xff0c;\u5c06\u8be5\u4f4d\u7f6e\u4e4b\u540e\u7684\u6240\u6709\u5143\u7d20\u5411\u524d\u79fb\u52a8\u4e00\u4e2a\u4f4d\u7f6e\u3002<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2026\/09\/20260909062519-6aa0fbcf72c82.png\" alt=\"\u5728\u8fd9\u91cc\u63d2\u5165\u56fe\u7247\u63cf\u8ff0\" \/><\/p>\n<p>\u628a\u7d22\u5f15\u4e3a3\u7684\u503c\u8d4b\u503c\u5230\u7d22\u5f15\u4e3a2\u7684\u4f4d\u7f6e,\u7d22\u5f15\u4e3a4\u7684\u4f4d\u7f6e\u8d4b\u503c\u5230\u7d22\u5f15\u4e3a3\u7684\u4f4d\u7f6e,<\/p>\n<p># \u5411\u6570\u7ec4\u4e2d\u8ffd\u52a0\u5143\u7d20<br \/>\ndef append(self,item):<br \/>\n    self.insert(self.__size,item)<\/p>\n<p># \u4ece\u6570\u7ec4\u6307\u5b9a\u7684\u4f4d\u7f6e\u5220\u9664\u5143\u7d20<br \/>\ndef remove(self,index):<br \/>\n    if index &lt; 0 or index &gt;&#061; self.__size:<br \/>\n        raise IndexError(&#034;index out of range&#034;)<\/p>\n<p>    for i in range(index, self.__size-1):<br \/>\n        self.__items[i] &#061; self.__items[i&#043;1]<\/p>\n<p>    self.__size -&#061; 1<\/p>\n<p>for i in range(index, self.__size):\u8fd9\u6837\u5199\u4e5f\u4e0d\u4f1a\u62a5\u9519,\u4f46\u4e0a\u76f8\u6bd4\u4e8e\u4e0a\u9762\u4ee3\u7801,\u591a\u6267\u884c\u4e86\u4e00\u6b65<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2026\/09\/20260909062519-6aa0fbcf8562f.png\" alt=\"\u5728\u8fd9\u91cc\u63d2\u5165\u56fe\u7247\u63cf\u8ff0\" \/><\/p>\n<p>\u56e0\u4e3a\u4e0d\u7ba1\u662fsize\u8fd8\u662fsize-1\u5982\u4f55\u5904\u7406,\u6700\u540e\u4e00\u4e2a\u7d22\u5f15\u4f1a\u88ab\u5220\u6389<\/p>\n<h4>2.1.8\u4fee\u6539\u5143\u7d20<\/h4>\n<p># \u4fee\u6539\u5143\u7d20<br \/>\ndef set(self,index,item):<br \/>\n    if index &lt; 0 or index &gt;&#061; self.__size:<br \/>\n        raise IndexError(&#034;index out of range&#034;)<\/p>\n<p>    self.__items[index] &#061; item<\/p>\n<h4>2.1.9\u8bbf\u95ee\u5143\u7d20<\/h4>\n<p>def get(self, index):<br \/>\n        &#034;&#034;&#034;\u8bbf\u95ee\u5143\u7d20&#034;&#034;&#034;<br \/>\n        if index &lt; 0 or index &gt;&#061; self.__size:<br \/>\n            raise IndexError<br \/>\n        return self.__items[index]<\/p>\n<h4>2.1.10\u67e5\u8be2\u5143\u7d20<\/h4>\n<p>def find(self, item):<br \/>\n        &#034;&#034;&#034;\u67e5\u627e\u5143\u7d20&#034;&#034;&#034;<br \/>\n        for i in range(self.__size):<br \/>\n            if self.__items[i] &#061;&#061; item:<br \/>\n                return i<br \/>\n        return -1<\/p>\n<h4>2.1.11\u904d\u5386\u5143\u7d20<\/h4>\n<p>def for_each(self, func):<br \/>\n        &#034;&#034;&#034;\u904d\u5386\u6570\u7ec4&#034;&#034;&#034;<br \/>\n        for i in range(self.__size):<br \/>\n            func(self.__items[i])<\/p>\n<h4>2.1.12 \u5b8c\u6574\u4ee3\u7801<\/h4>\n<p>class Array:<br \/>\n    def __init__(self):<br \/>\n        &#034;&#034;&#034;\u521d\u59cb\u5316\u6570\u7ec4&#034;&#034;&#034;<br \/>\n        self.__capacity &#061; 8<br \/>\n        self.__size &#061; 0<br \/>\n        self.__items &#061; [0] * 8<\/p>\n<p>    def __str__(self):<br \/>\n        &#034;&#034;&#034;\u6253\u5370\u6570\u7ec4&#034;&#034;&#034;<br \/>\n        arr_str &#061; &#034;[&#034;<br \/>\n        for i in range(self.__size):<br \/>\n            arr_str &#043;&#061; str(self.__items[i])<br \/>\n            if i &lt; self.__size &#8211; 1:<br \/>\n                arr_str &#043;&#061; &#034;, &#034;<br \/>\n        arr_str &#043;&#061; &#034;]&#034;<br \/>\n        return arr_str<\/p>\n<p>    &#064;property<br \/>\n    def size(self):<br \/>\n        &#034;&#034;&#034;\u83b7\u53d6\u6570\u7ec4\u5143\u7d20\u4e2a\u6570&#034;&#034;&#034;<br \/>\n        return self.__size<\/p>\n<p>    def is_empty(self):<br \/>\n        &#034;&#034;&#034;\u5224\u65ad\u6570\u7ec4\u662f\u5426\u4e3a\u7a7a&#034;&#034;&#034;<br \/>\n        return self.__size &#061;&#061; 0<\/p>\n<p>    def __grow(self):<br \/>\n        &#034;&#034;&#034;\u6570\u7ec4\u6269\u5bb9&#034;&#034;&#034;<br \/>\n        self.new___items &#061; [0] * self.__capacity * 2<br \/>\n        for i in range(self.__size):<br \/>\n            self.new___items[i] &#061; self.__items[i]<br \/>\n        self.__items &#061; self.new___items<br \/>\n        self.__capacity *&#061; 2<\/p>\n<p>    def insert(self, index, item):<br \/>\n        &#034;&#034;&#034;\u63d2\u5165\u5143\u7d20&#034;&#034;&#034;<br \/>\n        if index &lt; 0 or index &gt; self.__size:<br \/>\n            raise IndexError<br \/>\n        if self.__size &#061;&#061; self.__capacity:<br \/>\n            self.__grow()<br \/>\n        for i in range(self.__size, index, -1):<br \/>\n            self.__items[i] &#061; self.__items[i &#8211; 1]<br \/>\n        self.__items[index] &#061; item<br \/>\n        self.__size &#043;&#061; 1<\/p>\n<p>    def append(self, item):<br \/>\n        &#034;&#034;&#034;\u672b\u5c3e\u63d2\u5165\u5143\u7d20&#034;&#034;&#034;<br \/>\n        self.insert(self.__size, item)<\/p>\n<p>    def remove(self, index):<br \/>\n        &#034;&#034;&#034;\u5220\u9664\u5143\u7d20&#034;&#034;&#034;<br \/>\n        if index &lt; 0 or index &gt;&#061; self.__size:<br \/>\n            raise IndexError<br \/>\n        for i in range(index, self.__size &#8211; 1):<br \/>\n            self.__items[i] &#061; self.__items[i &#043; 1]<br \/>\n        self.__size -&#061; 1<\/p>\n<p>    def set(self, index, item):<br \/>\n        &#034;&#034;&#034;\u4fee\u6539\u5143\u7d20&#034;&#034;&#034;<br \/>\n        if index &lt; 0 or index &gt;&#061; self.__size:<br \/>\n            raise IndexError<br \/>\n        self.__items[index] &#061; item<\/p>\n<p>    def get(self, index):<br \/>\n        &#034;&#034;&#034;\u8bbf\u95ee\u5143\u7d20&#034;&#034;&#034;<br \/>\n        if index &lt; 0 or index &gt;&#061; self.__size:<br \/>\n            raise IndexError<br \/>\n        return self.__items[index]<\/p>\n<p>    def find(self, item):<br \/>\n        &#034;&#034;&#034;\u67e5\u627e\u5143\u7d20&#034;&#034;&#034;<br \/>\n        for i in range(self.__size):<br \/>\n            if self.__items[i] &#061;&#061; item:<br \/>\n                return i<br \/>\n        return -1<\/p>\n<p>    def for_each(self, func):<br \/>\n        &#034;&#034;&#034;\u904d\u5386\u6570\u7ec4&#034;&#034;&#034;<br \/>\n        for i in range(self.__size):<br \/>\n            func(self.__items[i])<\/p>\n<h3>2.2 \u94fe\u8868<\/h3>\n<h4>2.2.1 \u94fe\u8868\u7684\u6982\u8ff0<\/h4>\n<p>\u94fe\u8868&#xff08;Linked List&#xff09;\u662f\u4e00\u4e2a\u7ebf\u6027\u7ed3\u6784&#xff0c;\u7531\u4e00\u7cfb\u5217**\u8282\u70b9&#xff08;Node&#xff09;**\u7ec4\u6210&#xff0c;\u6bcf\u4e2a\u8282\u70b9\u5305\u542b\u4e00\u4e2a\u6570\u636e\u5143\u7d20\u548c\u4e00\u4e2a\u6307\u5411\u4e0b\u4e00\u8282\u70b9\u7684\u6307\u9488&#xff08;Pointer&#xff09;\u3002\u6240\u6709\u8282\u70b9\u901a\u8fc7\u6307\u9488\u76f8\u8fde&#xff0c;\u5f62\u6210\u4e00\u4e2a\u94fe\u5f0f\u7ed3\u6784\u3002\u901a\u5e38\u6211\u4eec\u5c06\u94fe\u8868\u4e2d\u7684\u7b2c\u4e00\u4e2a\u8282\u70b9\u79f0\u4e3a\u5934\u7ed3\u70b9&#xff0c;\u5e76\u5c06\u5934\u7ed3\u70b9\u7684\u4f4d\u7f6e\u4f5c\u4e3a\u6574\u4e2a\u94fe\u8868\u7684\u4f4d\u7f6e\u6807\u8bc6\u3002\u4e0e\u6570\u7ec4\u4e0d\u540c&#xff0c;\u94fe\u8868\u4e2d\u6bcf\u4e2a\u8282\u70b9\u5206\u6563\u7684\u5b58\u50a8\u5728\u5185\u5b58\u4e2d&#xff0c;\u6bcf\u4e2a\u8282\u70b9\u90fd\u4fdd\u5b58\u4e86\u5f53\u524d\u8282\u70b9\u7684\u6570\u636e\u548c\u4e0b\u4e00\u8282\u70b9\u7684\u5730\u5740&#xff08;\u6307\u9488&#xff09;\u3002<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2026\/09\/20260909062519-6aa0fbcfb8ecd.png\" alt=\"\u5728\u8fd9\u91cc\u63d2\u5165\u56fe\u7247\u63cf\u8ff0\" \/><\/p>\n<p>\u7531\u4e8e\u94fe\u8868\u4e2d\u8282\u70b9\u901a\u8fc7\u6307\u9488\u76f8\u8fde&#xff0c;\u63d2\u5165\u548c\u5220\u9664\u8282\u70b9\u53ea\u9700\u8981\u4fee\u6539\u6307\u9488\u7684\u6307\u5411\u5373\u53ef&#xff0c;\u800c\u4e0d\u9700\u8981\u50cf\u6570\u7ec4\u90a3\u6837\u79fb\u52a8\u6570\u636e\u3002\u4e14\u94fe\u8868\u4e0d\u9700\u8981\u50cf\u6570\u7ec4\u90a3\u6837\u9884\u5148\u6307\u5b9a\u5927\u5c0f&#xff0c;\u800c\u662f\u53ef\u4ee5\u968f\u65f6\u52a8\u6001\u7684\u589e\u957f\u6216\u7f29\u5c0f\u3002\u7531\u4e8e\u94fe\u8868\u4f7f\u7528\u5206\u6563\u5b58\u50a8\u7684\u65b9\u5f0f&#xff0c;\u56e0\u800c\u65e0\u9700\u4f7f\u7528\u5927\u6bb5\u8fde\u7eed\u7684\u5185\u5b58\u7a7a\u95f4\u3002<\/p>\n<p>\u7531\u4e8e\u94fe\u8868\u4e2d\u7684\u8282\u70b9\u4e0d\u662f\u8fde\u7eed\u5b58\u50a8\u7684&#xff0c;\u65e0\u6cd5\u50cf\u6570\u7ec4\u4e00\u6837\u6839\u636e\u7d22\u5f15\u76f4\u63a5\u8ba1\u7b97\u51fa\u6bcf\u4e2a\u8282\u70b9\u7684\u5730\u5740\u3002\u5fc5\u987b\u4ece\u5934\u8282\u70b9\u5f00\u59cb\u904d\u5386\u94fe\u8868&#xff0c;\u76f4\u5230\u627e\u5230\u76ee\u6807\u8282\u70b9&#xff0c;\u8fd9\u5bfc\u81f4\u4e86\u94fe\u8868\u7684\u968f\u673a\u8bbf\u95ee\u6548\u7387\u8f83\u4f4e\u3002\u94fe\u8868\u7684\u6bcf\u4e2a\u8282\u70b9\u90fd\u9700\u8981\u5b58\u50a8\u6307\u5411\u4e0b\u4e00\u4e2a\u8282\u70b9\u7684\u6307\u9488&#xff0c;\u8fd9\u4f1a\u5360\u7528\u989d\u5916\u7684\u5b58\u50a8\u7a7a\u95f4\u3002\u76f8\u6bd4\u4e8e\u6570\u7ec4&#xff0c;\u94fe\u8868\u9700\u8981\u66f4\u591a\u7684\u5185\u5b58\u7a7a\u95f4\u6765\u5b58\u50a8\u76f8\u540c\u6570\u91cf\u7684\u6570\u636e\u5143\u7d20\u3002<\/p>\n<p>\u5e38\u89c1\u7684\u94fe\u8868\u5305\u62ec\u4e09\u79cd&#xff1a;<\/p>\n<ul>\n<li>\n<p>\u5355\u5411\u94fe\u8868&#xff1a;\u5355\u5411\u94fe\u8868\u7684\u8282\u70b9\u5305\u542b\u503c\u548c\u6307\u5411\u4e0b\u4e00\u8282\u70b9\u7684\u5f15\u7528\u3002\u6211\u4eec\u5c06\u9996\u4e2a\u8282\u70b9\u79f0\u4e3a\u5934\u8282\u70b9&#xff0c;\u5c06\u6700\u540e\u4e00\u4e2a\u8282\u70b9\u79f0\u4e3a\u5c3e\u8282\u70b9&#xff0c;\u5c3e\u8282\u70b9\u6307\u5411\u7a7a None \u3002<\/p>\n<\/li>\n<li>\n<p>\u73af\u5f62\u94fe\u8868&#xff1a;\u5c06\u5355\u5411\u94fe\u8868\u7684\u5c3e\u8282\u70b9\u6307\u5411\u5934\u8282\u70b9&#xff08;\u9996\u5c3e\u76f8\u63a5&#xff09;&#xff0c;\u5219\u5f97\u5230\u4e00\u4e2a\u73af\u5f62\u94fe\u8868\u3002\u5728\u73af\u5f62\u94fe\u8868\u4e2d&#xff0c;\u4efb\u610f\u8282\u70b9\u90fd\u53ef\u4ee5\u89c6\u4f5c\u5934\u8282\u70b9\u3002<\/p>\n<\/li>\n<li>\n<p>\u53cc\u5411\u94fe\u8868&#xff1a;\u53cc\u5411\u94fe\u8868\u8bb0\u5f55\u4e86\u4e24\u4e2a\u65b9\u5411\u7684\u5f15\u7528&#xff0c;\u540c\u65f6\u5305\u542b\u6307\u5411\u540e\u7ee7\u8282\u70b9&#xff08;\u4e0b\u4e00\u4e2a\u8282\u70b9&#xff09;\u548c\u524d\u9a71\u8282\u70b9&#xff08;\u4e0a\u4e00\u4e2a\u8282\u70b9&#xff09;\u7684\u5f15\u7528\u3002<\/p>\n<\/li>\n<\/ul>\n<p>\u5355\u5411\u94fe\u8868:<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2026\/09\/20260909062519-6aa0fbcfc89db.png\" alt=\"\u5728\u8fd9\u91cc\u63d2\u5165\u56fe\u7247\u63cf\u8ff0\" \/><\/p>\n<p>\u53cc\u5411\u94fe\u8868:<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2026\/09\/20260909062520-6aa0fbd00350c.png\" alt=\"\u5728\u8fd9\u91cc\u63d2\u5165\u56fe\u7247\u63cf\u8ff0\" \/><\/p>\n<p>\u73af\u5f62\u94fe\u8868<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2026\/09\/20260909062520-6aa0fbd028069.png\" alt=\"\u5728\u8fd9\u91cc\u63d2\u5165\u56fe\u7247\u63cf\u8ff0\" \/><\/p>\n<h4>2.2.2 \u94fe\u8868\u7684\u529f\u80fd\u5b9a\u4e49<\/h4>\n<table>\n<tr>\u65b9\u6cd5\u8bf4\u660e<\/tr>\n<tbody>\n<tr>\n<td>size()<\/td>\n<td>\u8fd4\u56de\u94fe\u8868\u4e2d\u5143\u7d20\u4e2a\u6570<\/td>\n<\/tr>\n<tr>\n<td>is_empty()<\/td>\n<td>\u5224\u65ad\u94fe\u8868\u662f\u5426\u4e3a\u7a7a<\/td>\n<\/tr>\n<tr>\n<td>insert(index, item)<\/td>\n<td>\u5728\u6307\u5b9a\u4f4d\u7f6e\u63d2\u5165\u5143\u7d20<\/td>\n<\/tr>\n<tr>\n<td>append(item)<\/td>\n<td>\u5728\u672b\u5c3e\u63d2\u5165\u5143\u7d20<\/td>\n<\/tr>\n<tr>\n<td>remove(index)<\/td>\n<td>\u5220\u9664\u6307\u5b9a\u4f4d\u7f6e\u7684\u5143\u7d20<\/td>\n<\/tr>\n<tr>\n<td>set(index, item)<\/td>\n<td>\u4fee\u6539\u6307\u5b9a\u4f4d\u7f6e\u7684\u5143\u7d20<\/td>\n<\/tr>\n<tr>\n<td>get(index)<\/td>\n<td>\u83b7\u53d6\u6307\u5b9a\u4f4d\u7f6e\u7684\u5143\u7d20<\/td>\n<\/tr>\n<tr>\n<td>find(item)<\/td>\n<td>\u67e5\u627e\u94fe\u8868\u4e2d\u67d0\u4e2a\u5143\u7d20\u7684\u4f4d\u7f6e<\/td>\n<\/tr>\n<tr>\n<td>for_each(func)<\/td>\n<td>\u904d\u5386\u94fe\u8868<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<h4>2.2.3 \u94fe\u8868\u7684\u521b\u5efa<\/h4>\n<p>\u5b9e\u73b0\u4e00\u4e2a\u5355\u5411\u94fe\u8868\u3002<\/p>\n<p>class Node:<br \/>\n    *&#034;&#034;&#034;\u94fe\u8868\u4e0a\u7684\u8282\u70b9\u7c7b&#034;&#034;&#034;*<br \/>\n*    *def __init__(self, data,next&#061;None):<br \/>\n        self.data &#061; data<br \/>\n        self.next &#061; next<\/p>\n<p>class MyLinkedList:<br \/>\n    def __init__(self):<br \/>\n        # \u94fe\u8868\u4e0a\u7684\u5143\u7d20\u4e2a\u6570<br \/>\n        self.__size &#061; 0<br \/>\n        self.__head &#061; None<\/p>\n<p>    &#064;property<br \/>\n    def size(self):<br \/>\n        return self.__size<\/p>\n<p>    def is_empty(self):<br \/>\n        return self.__size &#061;&#061; 0<\/p>\n<p>    def __str__(self):<br \/>\n        res_list &#061; []<\/p>\n<p>        # \u600e\u4e48\u53d6\u51fa\u94fe\u8868\u4e0a\u7684\u5143\u7d20<br \/>\n        node &#061; self.__head<br \/>\n        while node:<br \/>\n            res_list.append(str(node.data))<br \/>\n            node &#061; node.next<\/p>\n<p>        return &#034;-&gt;&#034;.join(res_list)<\/p>\n<h4>2.2.4 \u6dfb\u52a0\/\u63d2\u5165\u5143\u7d20<\/h4>\n<p><img decoding=\"async\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2026\/09\/20260909062520-6aa0fbd05bda0.png\" alt=\"\u5728\u8fd9\u91cc\u63d2\u5165\u56fe\u7247\u63cf\u8ff0\" \/><\/p>\n<p><img decoding=\"async\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2026\/09\/20260909062520-6aa0fbd06cddf.png\" alt=\"\u5728\u8fd9\u91cc\u63d2\u5165\u56fe\u7247\u63cf\u8ff0\" \/><\/p>\n<p>def insert(self, index, item):<br \/>\n        &#034;&#034;&#034;\u63d2\u5165\u5143\u7d20&#034;&#034;&#034;<br \/>\n        if index &lt; 0 or index &gt; self.__size:<br \/>\n            raise IndexError<br \/>\n        if index &#061;&#061; 0:<br \/>\n            # \u63d2\u5165\u5230\u5934\u90e8&#xff0c;\u9700\u8981\u65b0\u5efa\u4e00\u4e2a\u8282\u70b9&#xff0c;\u7136\u540e\u8ba9\u65b0\u8282\u70b9\u7684next\u6307\u5411\u539f\u6765\u7684head&#xff0c;\u7136\u540e\u8ba9head\u6307\u5411\u65b0\u8282\u70b9<br \/>\n            self.__head &#061; Node(item, self.__head)<br \/>\n        else:<br \/>\n            # \u63d2\u5165\u5230\u4e2d\u95f4&#xff0c;\u5148\u627e\u5230index-1\u4f4d\u7f6e\u7684\u8282\u70b9<br \/>\n            node &#061; self.__head<br \/>\n            for i in range(**index &#8211; 1**):<br \/>\n                node &#061; node.next<br \/>\n            # \u65b0\u8282\u70b9\u7684next\u6307\u5411index\u4f4d\u7f6e\u7684\u8282\u70b9&#xff0c;\u7136\u540e\u8ba9index-1\u4f4d\u7f6e\u7684\u8282\u70b9\u7684next\u6307\u5411\u65b0\u8282\u70b9<br \/>\n            #(\u65b0\u8282\u70b9\u6307\u5411\u540e\u4e00\u4e2a\u8282\u70b9&#xff09;<br \/>\n            node.next &#061; Node(item, node.next)<br \/>\n        self.__size &#043;&#061; 1<\/p>\n<p>\u94fe\u8868\u4e2d\u6ca1\u6709\u7d22\u5f15\u53ef\u4ee5\u7406\u89e3\u4e3a\u7d22\u5f15&#xff0c;\u94fe\u8868\u4e2d\u60f3\u62ff\u5230\u5143\u7d20\u53ea\u80fd\u4ece\u5934\u5f00\u59cb\u505a\u5faa\u73af\u3002\u5982\u679c\u63d2\u5165\u5230\u5934\u90e8&#xff0c;\u91cd\u65b0\u6307\u5411\u4e00\u4e0b\u65b0\u7684\u5934\u90e8\u8282\u70b9&#xff0c;\u5982\u679c\u63d2\u5165\u5230\u4e2d\u95f4&#xff0c;\u6309\u7d22\u5f15\u7b97 \u6bd4\u5982\u57281\u548c2\u4e2d\u95f4\u63d2\u5165&#xff08;\u65b0\u7d22\u5f152\u7684\u4f4d\u7f6e&#xff09;&#xff0c;\u5c31\u662f\u5728\u7d22\u5f15\u4e3a1\u7684\u540e\u8fb9\u63d2\u5165&#xff0c;\u5c31\u9700\u8981\u5148\u627e\u52301&#xff08;index-1&#xff09;\u7684\u4f4d\u7f6e&#xff0c;\u4ece\u800c\u62ff\u52301\u7684\u6570\u636e&#xff0c;\u800c\u62ff\u52301\u7684\u6570\u636e\u53ea\u9700\u8981\u83b7\u53d61\u524d\u8fb9\u7684\u7d22\u5f15\u4f4d\u7f6e\u7684\u4fe1\u606f.next\u5c31\u53ef\u4ee5\u62ff\u5230\u4e86&#xff0c;\u5c31\u662f\u7d22\u5f15\u4e3a0\u7684\u4f4d\u7f6e&#xff0c;\u76f8\u5f53\u4e8e\u5b9e\u9645\u62ff\u5230\u7684\u662findex-2\u7684\u4f4d\u7f6e&#xff0c;\u4f46\u56e0\u4e3arange\u5de6\u5f00\u53f3\u95ed&#xff0c;\u56e0\u6b64\u5b9e\u9645\u5199\u4e3aindex-1<\/p>\n<p>\u5728\u672b\u5c3e\u63d2\u5165\u5143\u7d20\u65f6&#xff0c;\u4f7f\u7528insert()\u5e76\u5c06index\u8bbe\u7f6e\u4e3a\u94fe\u8868\u957f\u5ea6\u3002<\/p>\n<p>def append(self, item):<br \/>\n        &#034;&#034;&#034;\u672b\u5c3e\u63d2\u5165\u5143\u7d20&#034;&#034;&#034;<br \/>\n        self.insert(self.__size, item)<\/p>\n<h4>2.2.5 \u5220\u9664\u5143\u7d20<\/h4>\n<p><img decoding=\"async\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2026\/09\/20260909062520-6aa0fbd089b4d.png\" alt=\"\u5728\u8fd9\u91cc\u63d2\u5165\u56fe\u7247\u63cf\u8ff0\" \/><\/p>\n<p>def remove(self, index):<br \/>\n        &#034;&#034;&#034;\u5220\u9664\u5143\u7d20&#034;&#034;&#034;<br \/>\n        if index &lt; 0 or index &gt;&#061; self.__size:<br \/>\n            raise IndexError<br \/>\n        if index &#061;&#061; 0:<br \/>\n            # \u4e0b\u4e00\u4e2a\u8282\u70b9\u6539\u4e3a\u5934\u8282\u70b9<br \/>\n            self.__head &#061; self.__head.next<br \/>\n        else:<br \/>\n            # \u627e\u5230index-1\u4f4d\u7f6e\u7684\u8282\u70b9&#xff0c;\u7136\u540e\u8ba9index-1\u4f4d\u7f6e\u7684\u8282\u70b9\u7684next\u6307\u5411index\u4f4d\u7f6e\u7684\u8282\u70b9\u7684next<br \/>\n            node &#061; self.__head<br \/>\n            for i in range(index &#8211; 1):<br \/>\n                node &#061; node.next<br \/>\n            node.next &#061; node.next.next<br \/>\n        self.__size -&#061; 1<\/p>\n<h4>2.2.6 \u4fee\u6539\u5143\u7d20<\/h4>\n<p>def set(self, index, item):<br \/>\n        &#034;&#034;&#034;\u4fee\u6539\u5143\u7d20&#034;&#034;&#034;<br \/>\n        if index &lt; 0 or index &gt;&#061; self.__size:<br \/>\n            raise IndexError<br \/>\n        node &#061; self.__head<br \/>\n        for i in range(index):<br \/>\n            #\u6bd4\u5982\u7d22\u5f15\u4e3a3&#xff0c;node\u5c31\u662f\u7b2c\u4e8c\u4e2a\u7d22\u5f15\u4f4d\u7f6e&#xff0c;node.next\u5c31\u662f\u7b2c\u4e09\u4e2a\u7d22\u5f15\u8282\u70b9<br \/>\n            node &#061; node.next<br \/>\n        node.data &#061; item<\/p>\n<h4>2.2.7 \u8bbf\u95ee\u5143\u7d20<\/h4>\n<p>def get(self, index):<br \/>\n        &#034;&#034;&#034;\u8bbf\u95ee\u5143\u7d20&#034;&#034;&#034;<br \/>\n        if index &lt; 0 or index &gt;&#061; self.__size:<br \/>\n            raise IndexError<br \/>\n        node &#061; self.__head<br \/>\n        for i in range(index):<br \/>\n            node &#061; node.next<br \/>\n        return node.data<\/p>\n<h4>2.2.8 \u67e5\u627e\u5143\u7d20<\/h4>\n<p>def find(self, item):<br \/>\n        &#034;&#034;&#034;\u67e5\u627e\u5143\u7d20&#034;&#034;&#034;<br \/>\n        node &#061; self.__head<br \/>\n        while node:<br \/>\n            if node.data &#061;&#061; item:<br \/>\n                return True<br \/>\n            node &#061; node.next<br \/>\n        return False<\/p>\n<p>\u83b7\u53d6\u5143\u7d20\u7b2c\u4e00\u6b21\u7684\u7d22\u5f15<\/p>\n<p>def find(self,item):<br \/>\n    node &#061; self.__head<br \/>\n    for i in range(self.__size):<br \/>\n        if node.data &#061;&#061; item:<br \/>\n            return i<br \/>\n        node &#061; node.next<\/p>\n<p>    return -1<\/p>\n<h4>2.2.9 \u904d\u5386\u94fe\u8868<\/h4>\n<p>def for_each(self, func):<br \/>\n        &#034;&#034;&#034;\u904d\u5386\u94fe\u8868&#034;&#034;&#034;<br \/>\n        node &#061; self.__head<br \/>\n        while node:<br \/>\n            func(node)<br \/>\n            node &#061; node.next<\/p>\n<h4>2.2.10 \u5b8c\u6574\u4ee3\u7801<\/h4>\n<p>class Node:<br \/>\n    def __init__(self, data, next&#061;None):<br \/>\n        self.data &#061; data<br \/>\n        self.next &#061; next<\/p>\n<p>class LinkedList:<br \/>\n    def __init__(self):<br \/>\n        &#034;&#034;&#034;\u521d\u59cb\u5316\u94fe\u8868&#034;&#034;&#034;<br \/>\n        self.__head &#061; None<br \/>\n        self.__size &#061; 0<\/p>\n<p>    def __str__(self):<br \/>\n        &#034;&#034;&#034;\u6253\u5370\u94fe\u8868&#034;&#034;&#034;<br \/>\n        result &#061; []<br \/>\n        current &#061; self.__head<br \/>\n        while current:<br \/>\n            result.append(str(current.data))<br \/>\n            current &#061; current.next<br \/>\n        return &#034; -&gt; &#034;.join(result)<\/p>\n<p>    &#064;property<br \/>\n    def size(self):<br \/>\n        &#034;&#034;&#034;\u83b7\u53d6\u94fe\u8868\u5143\u7d20\u4e2a\u6570&#034;&#034;&#034;<br \/>\n        return self.__size<\/p>\n<p>    def is_empty(self):<br \/>\n        &#034;&#034;&#034;\u5224\u65ad\u94fe\u8868\u662f\u5426\u4e3a\u7a7a&#034;&#034;&#034;<br \/>\n        return self.__size &#061;&#061; 0<\/p>\n<p>    def insert(self, index, item):<br \/>\n        &#034;&#034;&#034;\u63d2\u5165\u5143\u7d20&#034;&#034;&#034;<br \/>\n        if index &lt; 0 or index &gt; self.__size:<br \/>\n            raise IndexError<br \/>\n        if index &#061;&#061; 0:<br \/>\n            # \u63d2\u5165\u5230\u5934\u90e8&#xff0c;\u9700\u8981\u65b0\u5efa\u4e00\u4e2a\u8282\u70b9&#xff0c;\u7136\u540e\u8ba9\u65b0\u8282\u70b9\u7684next\u6307\u5411\u539f\u6765\u7684head&#xff0c;\u7136\u540e\u8ba9head\u6307\u5411\u65b0\u8282\u70b9<br \/>\n            self.__head &#061; Node(item, self.__head)<br \/>\n        else:<br \/>\n            # \u63d2\u5165\u5230\u4e2d\u95f4&#xff0c;\u5148\u627e\u5230index-1\u4f4d\u7f6e\u7684\u8282\u70b9<br \/>\n            node &#061; self.__head<br \/>\n            for i in range(index &#8211; 1):<br \/>\n                node &#061; node.next<br \/>\n            # \u65b0\u8282\u70b9\u7684next\u6307\u5411index\u4f4d\u7f6e\u7684\u8282\u70b9&#xff0c;\u7136\u540e\u8ba9index-1\u4f4d\u7f6e\u7684\u8282\u70b9\u7684next\u6307\u5411\u65b0\u8282\u70b9<br \/>\n            node.next &#061; Node(item, node.next)<br \/>\n        self.__size &#043;&#061; 1<\/p>\n<p>    def append(self, item):<br \/>\n        &#034;&#034;&#034;\u672b\u5c3e\u63d2\u5165\u5143\u7d20&#034;&#034;&#034;<br \/>\n        self.insert(self.__size, item)<\/p>\n<p>    def remove(self, index):<br \/>\n        &#034;&#034;&#034;\u5220\u9664\u5143\u7d20&#034;&#034;&#034;<br \/>\n        if index &lt; 0 or index &gt;&#061; self.__size:<br \/>\n            raise IndexError<br \/>\n        if index &#061;&#061; 0:<br \/>\n            self.__head &#061; self.__head.next<br \/>\n        else:<br \/>\n            # \u627e\u5230index-1\u4f4d\u7f6e\u7684\u8282\u70b9&#xff0c;\u7136\u540e\u8ba9index-1\u4f4d\u7f6e\u7684\u8282\u70b9\u7684next\u6307\u5411index\u4f4d\u7f6e\u7684\u8282\u70b9\u7684next<br \/>\n            node &#061; self.__head<br \/>\n            for i in range(index &#8211; 1):<br \/>\n                node &#061; node.next<br \/>\n            node.next &#061; node.next.next<br \/>\n        self.__size -&#061; 1<\/p>\n<p>    def set(self, index, item):<br \/>\n        &#034;&#034;&#034;\u4fee\u6539\u5143\u7d20&#034;&#034;&#034;<br \/>\n        if index &lt; 0 or index &gt;&#061; self.__size:<br \/>\n            raise IndexError<br \/>\n        node &#061; self.__head<br \/>\n        for i in range(index):<br \/>\n            node &#061; node.next<br \/>\n        node.data &#061; item<\/p>\n<p>    def get(self, index):<br \/>\n        &#034;&#034;&#034;\u8bbf\u95ee\u5143\u7d20&#034;&#034;&#034;<br \/>\n        if index &lt; 0 or index &gt;&#061; self.__size:<br \/>\n            raise IndexError<br \/>\n        node &#061; self.__head<br \/>\n        for i in range(index):<br \/>\n            node &#061; node.next<br \/>\n        return node.data<\/p>\n<p>    def find(self, item):<br \/>\n        &#034;&#034;&#034;\u67e5\u627e\u5143\u7d20&#034;&#034;&#034;<br \/>\n        node &#061; self.__head<br \/>\n        while node:<br \/>\n            if node.data &#061;&#061; item:<br \/>\n                return True<br \/>\n            node &#061; node.next<br \/>\n        return False<\/p>\n<p>    def for_each(self, func):<br \/>\n        &#034;&#034;&#034;\u904d\u5386\u94fe\u8868&#034;&#034;&#034;<br \/>\n        node &#061; self.__head<br \/>\n        while node:<br \/>\n            func(node)<br \/>\n            node &#061; node.next<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u7b2c 2 \u7ae0 \u5e38\u7528\u6570\u636e\u7ed3\u6784<br \/>\n\u62bd\u8c61\u6570\u636e\u7c7b\u578b&#xff08;Abstract Data Type&#xff0c;\u7b80\u79f0 ADT&#xff09;\u662f\u8ba1\u7b97\u673a\u79d1\u5b66\u4e2d\u4e00\u4e2a\u91cd\u8981\u7684\u6982\u5ff5&#xff0c;\u5b83\u662f\u5bf9\u6570\u636e\u7684\u4e00\u79cd\u62bd\u8c61\u63cf\u8ff0&#xff0c;\u5173\u6ce8\u6570\u636e\u7684\u903b\u8f91\u7279\u6027\u548c\u64cd\u4f5c&#xff0c;\u800c\u4e0d\u6d89\u53ca\u5177\u4f53\u7684\u5b9e\u73b0\u7ec6\u8282\u3002<br \/>\n\u62bd\u8c61\u6570\u636e\u7c7b\u578b\u901a\u5e38\u7531\u4ee5\u4e0b\u4e24\u90e8\u5206\u7ec4\u6210&#xff1a; \u6570\u636e\u5bf9\u8c61&#xff1a;\u63cf\u8ff0\u4e86\u8be5\u6570\u636e\u7c7b\u578b\u6240\u5305\u542b\u7684\u6570\u636e\u5143\u7d20\u4ee5\u53ca\u5b83\u4eec\u4e4b\u95f4\u7684\u903b\u8f91\u5173\u7cfb\u3002\u4f8b\u5982&#xff0c;\u5728\u4e00\u4e2a\u6808\u7684\u62bd\u8c61\u6570\u636e\u7c7b\u578b\u4e2d&#xff0c;\u6570<\/p>\n","protected":false},"author":2,"featured_media":102794,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[81,1813,305],"topic":[],"class_list":["post-102811","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-server","tag-python","tag-1813","tag-305"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v20.3 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>\u6570\u636e\u7ed3\u6784\u4e0e\u7b97\u6cd5- \u7b2c 2 \u7ae0 \u5e38\u7528\u6570\u636e\u7ed3\u6784 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.wsisp.com\/helps\/102811.html\" \/>\n<meta property=\"og:locale\" content=\"zh_CN\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"\u6570\u636e\u7ed3\u6784\u4e0e\u7b97\u6cd5- \u7b2c 2 \u7ae0 \u5e38\u7528\u6570\u636e\u7ed3\u6784 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\" \/>\n<meta property=\"og:description\" content=\"\u7b2c 2 \u7ae0 \u5e38\u7528\u6570\u636e\u7ed3\u6784 \u62bd\u8c61\u6570\u636e\u7c7b\u578b&#xff08;Abstract Data Type&#xff0c;\u7b80\u79f0 ADT&#xff09;\u662f\u8ba1\u7b97\u673a\u79d1\u5b66\u4e2d\u4e00\u4e2a\u91cd\u8981\u7684\u6982\u5ff5&#xff0c;\u5b83\u662f\u5bf9\u6570\u636e\u7684\u4e00\u79cd\u62bd\u8c61\u63cf\u8ff0&#xff0c;\u5173\u6ce8\u6570\u636e\u7684\u903b\u8f91\u7279\u6027\u548c\u64cd\u4f5c&#xff0c;\u800c\u4e0d\u6d89\u53ca\u5177\u4f53\u7684\u5b9e\u73b0\u7ec6\u8282\u3002 \u62bd\u8c61\u6570\u636e\u7c7b\u578b\u901a\u5e38\u7531\u4ee5\u4e0b\u4e24\u90e8\u5206\u7ec4\u6210&#xff1a; \u6570\u636e\u5bf9\u8c61&#xff1a;\u63cf\u8ff0\u4e86\u8be5\u6570\u636e\u7c7b\u578b\u6240\u5305\u542b\u7684\u6570\u636e\u5143\u7d20\u4ee5\u53ca\u5b83\u4eec\u4e4b\u95f4\u7684\u903b\u8f91\u5173\u7cfb\u3002\u4f8b\u5982&#xff0c;\u5728\u4e00\u4e2a\u6808\u7684\u62bd\u8c61\u6570\u636e\u7c7b\u578b\u4e2d&#xff0c;\u6570\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.wsisp.com\/helps\/102811.html\" \/>\n<meta property=\"og:site_name\" content=\"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\" \/>\n<meta property=\"article:published_time\" content=\"2026-09-09T06:25:22+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2026\/09\/20260909062518-6aa0fbce46d08.png\" \/>\n<meta name=\"author\" content=\"admin\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"\u4f5c\u8005\" \/>\n\t<meta name=\"twitter:data1\" content=\"admin\" \/>\n\t<meta name=\"twitter:label2\" content=\"\u9884\u8ba1\u9605\u8bfb\u65f6\u95f4\" \/>\n\t<meta name=\"twitter:data2\" content=\"7 \u5206\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/102811.html\",\"url\":\"https:\/\/www.wsisp.com\/helps\/102811.html\",\"name\":\"\u6570\u636e\u7ed3\u6784\u4e0e\u7b97\u6cd5- \u7b2c 2 \u7ae0 \u5e38\u7528\u6570\u636e\u7ed3\u6784 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\",\"isPartOf\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/#website\"},\"datePublished\":\"2026-09-09T06:25:22+00:00\",\"dateModified\":\"2026-09-09T06:25:22+00:00\",\"author\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41\"},\"breadcrumb\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/102811.html#breadcrumb\"},\"inLanguage\":\"zh-Hans\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.wsisp.com\/helps\/102811.html\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/102811.html#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"\u9996\u9875\",\"item\":\"https:\/\/www.wsisp.com\/helps\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"\u6570\u636e\u7ed3\u6784\u4e0e\u7b97\u6cd5- \u7b2c 2 \u7ae0 \u5e38\u7528\u6570\u636e\u7ed3\u6784\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/#website\",\"url\":\"https:\/\/www.wsisp.com\/helps\/\",\"name\":\"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\",\"description\":\"\u9999\u6e2f\u670d\u52a1\u5668_\u9999\u6e2f\u4e91\u670d\u52a1\u5668\u8d44\u8baf_\u670d\u52a1\u5668\u5e2e\u52a9\u6587\u6863_\u670d\u52a1\u5668\u6559\u7a0b\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/www.wsisp.com\/helps\/?s={search_term_string}\"},\"query-input\":\"required name=search_term_string\"}],\"inLanguage\":\"zh-Hans\"},{\"@type\":\"Person\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41\",\"name\":\"admin\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"zh-Hans\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery\",\"contentUrl\":\"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery\",\"caption\":\"admin\"},\"sameAs\":[\"http:\/\/wp.wsisp.com\"],\"url\":\"https:\/\/www.wsisp.com\/helps\/author\/admin\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"\u6570\u636e\u7ed3\u6784\u4e0e\u7b97\u6cd5- \u7b2c 2 \u7ae0 \u5e38\u7528\u6570\u636e\u7ed3\u6784 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.wsisp.com\/helps\/102811.html","og_locale":"zh_CN","og_type":"article","og_title":"\u6570\u636e\u7ed3\u6784\u4e0e\u7b97\u6cd5- \u7b2c 2 \u7ae0 \u5e38\u7528\u6570\u636e\u7ed3\u6784 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","og_description":"\u7b2c 2 \u7ae0 \u5e38\u7528\u6570\u636e\u7ed3\u6784 \u62bd\u8c61\u6570\u636e\u7c7b\u578b&#xff08;Abstract Data Type&#xff0c;\u7b80\u79f0 ADT&#xff09;\u662f\u8ba1\u7b97\u673a\u79d1\u5b66\u4e2d\u4e00\u4e2a\u91cd\u8981\u7684\u6982\u5ff5&#xff0c;\u5b83\u662f\u5bf9\u6570\u636e\u7684\u4e00\u79cd\u62bd\u8c61\u63cf\u8ff0&#xff0c;\u5173\u6ce8\u6570\u636e\u7684\u903b\u8f91\u7279\u6027\u548c\u64cd\u4f5c&#xff0c;\u800c\u4e0d\u6d89\u53ca\u5177\u4f53\u7684\u5b9e\u73b0\u7ec6\u8282\u3002 \u62bd\u8c61\u6570\u636e\u7c7b\u578b\u901a\u5e38\u7531\u4ee5\u4e0b\u4e24\u90e8\u5206\u7ec4\u6210&#xff1a; \u6570\u636e\u5bf9\u8c61&#xff1a;\u63cf\u8ff0\u4e86\u8be5\u6570\u636e\u7c7b\u578b\u6240\u5305\u542b\u7684\u6570\u636e\u5143\u7d20\u4ee5\u53ca\u5b83\u4eec\u4e4b\u95f4\u7684\u903b\u8f91\u5173\u7cfb\u3002\u4f8b\u5982&#xff0c;\u5728\u4e00\u4e2a\u6808\u7684\u62bd\u8c61\u6570\u636e\u7c7b\u578b\u4e2d&#xff0c;\u6570","og_url":"https:\/\/www.wsisp.com\/helps\/102811.html","og_site_name":"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","article_published_time":"2026-09-09T06:25:22+00:00","og_image":[{"url":"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2026\/09\/20260909062518-6aa0fbce46d08.png"}],"author":"admin","twitter_card":"summary_large_image","twitter_misc":{"\u4f5c\u8005":"admin","\u9884\u8ba1\u9605\u8bfb\u65f6\u95f4":"7 \u5206"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/www.wsisp.com\/helps\/102811.html","url":"https:\/\/www.wsisp.com\/helps\/102811.html","name":"\u6570\u636e\u7ed3\u6784\u4e0e\u7b97\u6cd5- \u7b2c 2 \u7ae0 \u5e38\u7528\u6570\u636e\u7ed3\u6784 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","isPartOf":{"@id":"https:\/\/www.wsisp.com\/helps\/#website"},"datePublished":"2026-09-09T06:25:22+00:00","dateModified":"2026-09-09T06:25:22+00:00","author":{"@id":"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41"},"breadcrumb":{"@id":"https:\/\/www.wsisp.com\/helps\/102811.html#breadcrumb"},"inLanguage":"zh-Hans","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.wsisp.com\/helps\/102811.html"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.wsisp.com\/helps\/102811.html#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"\u9996\u9875","item":"https:\/\/www.wsisp.com\/helps"},{"@type":"ListItem","position":2,"name":"\u6570\u636e\u7ed3\u6784\u4e0e\u7b97\u6cd5- \u7b2c 2 \u7ae0 \u5e38\u7528\u6570\u636e\u7ed3\u6784"}]},{"@type":"WebSite","@id":"https:\/\/www.wsisp.com\/helps\/#website","url":"https:\/\/www.wsisp.com\/helps\/","name":"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","description":"\u9999\u6e2f\u670d\u52a1\u5668_\u9999\u6e2f\u4e91\u670d\u52a1\u5668\u8d44\u8baf_\u670d\u52a1\u5668\u5e2e\u52a9\u6587\u6863_\u670d\u52a1\u5668\u6559\u7a0b","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.wsisp.com\/helps\/?s={search_term_string}"},"query-input":"required name=search_term_string"}],"inLanguage":"zh-Hans"},{"@type":"Person","@id":"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41","name":"admin","image":{"@type":"ImageObject","inLanguage":"zh-Hans","@id":"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/image\/","url":"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery","contentUrl":"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery","caption":"admin"},"sameAs":["http:\/\/wp.wsisp.com"],"url":"https:\/\/www.wsisp.com\/helps\/author\/admin"}]}},"_links":{"self":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/posts\/102811","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/comments?post=102811"}],"version-history":[{"count":0,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/posts\/102811\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/media\/102794"}],"wp:attachment":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/media?parent=102811"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/categories?post=102811"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/tags?post=102811"},{"taxonomy":"topic","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/topic?post=102811"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}