{"id":813,"date":"2009-06-14T13:25:33","date_gmt":"2009-06-14T05:25:33","guid":{"rendered":"http:\/\/www.slyar.com\/blog\/?p=813"},"modified":"2014-04-22T13:50:23","modified_gmt":"2014-04-22T05:50:23","slug":"disjoint-set","status":"publish","type":"post","link":"http:\/\/www.slyar.com\/blog\/disjoint-set.html","title":{"rendered":"\u4e0d\u76f8\u4ea4\u96c6\u5408 - \u5e76\u67e5\u96c6"},"content":{"rendered":"<p>\u6587\u7ae0\u4f5c\u8005\uff1a<span style=\"color: #0000ff;\">\u59dc\u5357(Slyar) <\/span>\u6587\u7ae0\u6765\u6e90\uff1aSlyar Home (<a title=\"Slyar\" href=\"http:\/\/www.slyar.com\" target=\"_blank\">www.slyar.com<\/a>) \u8f6c\u8f7d\u8bf7\u6ce8\u660e\uff0c\u8c22\u8c22\u5408\u4f5c\u3002<\/p>\n<p>\u6069\uff0c\u524d\u4e24\u5468\u5b66\u4e60\u4e86\u5e76\u67e5\u96c6\uff0c\u662f\u65f6\u5019\u603b\u7ed3\u4e00\u4e0b\u4e86\u3002<\/p>\n<p><strong>\u7b49\u4ef7\u5173\u7cfb\u4e0e\u7b49\u4ef7\u7c7b<\/strong><\/p>\n<p>\u4ece\u6570\u5b66\u4e0a\u770b\uff0c\u7b49\u4ef7\u7c7b\u662f\u4e00\u4e2a\u5bf9\u8c61(\u6216\u6210\u5458)\u7684\u96c6\u5408\uff0c\u5728\u6b64\u96c6\u5408\u4e2d\u7684\u6240\u6709\u5bf9\u8c61\u5e94\u6ee1\u8db3\u7b49\u4ef7\u5173\u7cfb\u3002\u82e5\u7528\u7b26\u53f7\"\u2261\"\u8868\u793a\u96c6\u5408\u4e0a\u7684\u7b49\u4ef7\u5173\u7cfb\uff0c\u90a3\u4e48\u5bf9\u4e8e\u8be5\u96c6\u5408\u4e2d\u7684\u4efb\u610f\u5bf9\u8c61x,y, z\uff0c\u4e0b\u5217\u6027\u8d28\u6210\u7acb\uff1a<\/p>\n<p>1\u3001\u81ea\u53cd\u6027\uff1ax \u2261 x<\/p>\n<p>2\u3001\u5bf9\u79f0\u6027\uff1a\u82e5 x \u2261 y \u5219 y \u2261 x<\/p>\n<p>3\u3001\u4f20\u9012\u6027\uff1a\u82e5 x \u2261 y \u4e14 y \u2261 z \u5219 x \u2261 z<\/p>\n<p>\u56e0\u6b64\uff0c\u7b49\u4ef7\u5173\u7cfb\u662f\u96c6\u5408\u4e0a\u7684\u4e00\u4e2a\u81ea\u53cd\u3001\u5bf9\u79f0\u3001\u4f20\u9012\u7684\u5173\u7cfb\u3002<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-814 alignnone\" style=\"border: 1px solid black; margin: 2px;\" title=\"\u7b49\u4ef7\u5173\u7cfb\" src=\"http:\/\/www.slyar.com\/blog\/wp-content\/uploads\/2009\/06\/lights.gif\" alt=\"\u7b49\u4ef7\u5173\u7cfb\" width=\"200\" height=\"100\" \/><\/p>\n<p>\u901a\u8fc7\u91d1\u5c5e\u7ebf\u8fde\u63a5\u8d77\u6765\u7684\u7535\u5668\u7684\u8fde\u901a\u6027\uff0c\u5c31\u662f\u4e00\u79cd\u7b49\u4ef7\u5173\u7cfb\u3002\u8fd9\u79cd\u5173\u7cfb\u663e\u7136\u5177\u6709\u81ea\u53cd\u6027\uff0c\u56e0\u4e3a\u4efb\u4f55\u4e00\u4e2a\u5668\u4ef6\u90fd\u662f\u4e0e\u81ea\u8eab\u8fde\u901a\u7684\uff1b\u5982\u679ca \u7535\u8fde\u901ab\uff0c\u90a3\u4e48b\u4e00\u5b9a\u4e5f\u7535\u8fde\u901aa\uff0c\u56e0\u6b64\u8fd9\u79cd\u5173\u7cfb\u5177\u6709\u5bf9\u79f0\u6027\uff1b \u82e5a\u8fde\u901a\u5230b\uff0c\u5e76\u4e14b\u8fde\u901a\u5230c\uff0c\u90a3\u4e48a\u8fde\u901a\u5230c \u3002<\/p>\n<p><strong>\u5e76\u67e5\u96c6<\/strong><\/p>\n<p>\u5e76\u67e5\u96c6\u7684\u4e00\u822c\u7528\u9014\u5c31\u662f\u7528\u6765\u7ef4\u62a4\u67d0\u79cd\u5177\u6709\u81ea\u53cd\u3001\u5bf9\u79f0\u3001\u4f20\u9012\u6027\u8d28\u7684\u5173\u7cfb\u7684\u7b49\u4ef7\u7c7b\u3002\u5e76\u67e5\u96c6\u4e00\u822c\u4ee5\u6811\u5f62\u7ed3\u6784\u5b58\u50a8\uff0c\u591a\u68f5\u6811\u6784\u6210\u4e00\u4e2a\u68ee\u6797\uff0c\u6bcf\u68f5\u6811\u6784\u6210\u4e00\u4e2a\u96c6\u5408\uff0c\u6811\u4e2d\u7684\u6bcf\u4e2a\u8282\u70b9\u5c31\u662f\u8be5\u96c6\u5408\u7684\u5143\u7d20\uff0c\u627e\u4e00\u4e2a\u4ee3\u8868\u5143\u7d20\u4f5c\u4e3a\u8be5\u6811(\u96c6\u5408)\u7684\u7956\u5148\u3002<\/p>\n<p>\u5e76\u67e5\u96c6\u652f\u6301\u4ee5\u4e0b\u4e09\u79cd\u64cd\u4f5c\uff1a<\/p>\n<p><span style=\"color: #0000ff;\">1\u3001Make_Set(x) \u628a\u6bcf\u4e00\u4e2a\u5143\u7d20\u521d\u59cb\u5316\u4e3a\u4e00\u4e2a\u96c6\u5408<\/span><\/p>\n<p>\u521d\u59cb\u5316\u540e\u6bcf\u4e00\u4e2a\u5143\u7d20\u7684\u7236\u4eb2\u8282\u70b9\u662f\u5b83\u672c\u8eab\uff0c\u6bcf\u4e00\u4e2a\u5143\u7d20\u7684\u7956\u5148\u8282\u70b9\u4e5f\u662f\u5b83\u672c\u8eab\u3002<\/p>\n<p><span style=\"color: #0000ff;\">2\u3001Find_Set(x) \u67e5\u627e\u4e00\u4e2a\u5143\u7d20\u6240\u5728\u7684\u96c6\u5408<\/span><\/p>\n<p>\u67e5\u627e\u4e00\u4e2a\u5143\u7d20\u6240\u5728\u7684\u96c6\u5408\uff0c\u53ea\u8981\u627e\u5230\u8fd9\u4e2a\u5143\u7d20\u6240\u5728\u96c6\u5408\u7684\u7956\u5148\u5373\u53ef\u3002\u5224\u65ad\u4e24\u4e2a\u5143\u7d20\u662f\u5426\u5c5e\u4e8e\u540c\u4e00\u96c6\u5408\uff0c\u53ea\u8981\u770b\u4ed6\u4eec\u6240\u5728\u96c6\u5408\u7684\u7956\u5148\u662f\u5426\u76f8\u540c\u5373\u53ef\u3002<\/p>\n<p><span style=\"color: #0000ff;\">3\u3001Union(x,y) \u5408\u5e76x,y\u6240\u5728\u7684\u4e24\u4e2a\u96c6\u5408<\/span><\/p>\n<p>\u5408\u5e76\u4e24\u4e2a\u4e0d\u76f8\u4ea4\u96c6\u5408\u64cd\u4f5c\u5f88\u7b80\u5355\uff1a\u9996\u5148\u8bbe\u7f6e\u4e00\u4e2a\u6570\u7ec4Father[x]\uff0c\u8868\u793ax\u7684\"\u7236\u4eb2\"\u7684\u7f16\u53f7\u3002\u90a3\u4e48\uff0c\u5408\u5e76\u4e24\u4e2a\u4e0d\u76f8\u4ea4\u96c6\u5408\u7684\u65b9\u6cd5\u5c31\u662f\uff0c\u627e\u5230\u5176\u4e2d\u4e00\u4e2a\u96c6\u5408\u7684\u7956\u5148\uff0c\u5c06\u53e6\u5916\u4e00\u4e2a\u96c6\u5408\u7684\u7956\u5148\u6307\u5411\u5b83\u3002<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-815 alignnone\" title=\"\u5408\u5e76\" src=\"http:\/\/www.slyar.com\/blog\/wp-content\/uploads\/2009\/06\/Dis-Union.jpg\" alt=\"\u5408\u5e76\" width=\"433\" height=\"163\" srcset=\"http:\/\/www.slyar.com\/blog\/wp-content\/uploads\/2009\/06\/Dis-Union.jpg 433w, http:\/\/www.slyar.com\/blog\/wp-content\/uploads\/2009\/06\/Dis-Union-150x56.jpg 150w, http:\/\/www.slyar.com\/blog\/wp-content\/uploads\/2009\/06\/Dis-Union-300x113.jpg 300w\" sizes=\"auto, (max-width: 433px) 100vw, 433px\" \/><\/p>\n<p><strong>\u5e76\u67e5\u96c6\u7684\u4f18\u5316<\/strong><\/p>\n<p><span style=\"color: #0000ff;\">1\u3001Find_Set(x)\u65f6 \u8def\u5f84\u538b\u7f29<\/span><\/p>\n<p>\u5bfb\u627e\u7956\u5148\u65f6\u6211\u4eec\u4e00\u822c\u91c7\u7528\u9012\u5f52\u67e5\u627e\uff0c\u4f46\u662f\u5f53\u5143\u7d20\u5f88\u591a\u4ea6\u6216\u662f\u6574\u68f5\u6811\u53d8\u4e3a\u4e00\u6761\u94fe\u65f6\uff0c\u6bcf\u6b21Find_Set(x)\u90fd\u662fO(n)\u7684\u590d\u6742\u5ea6\uff0c\u6709\u6ca1\u6709\u529e\u6cd5\u51cf\u5c0f\u8fd9\u4e2a\u590d\u6742\u5ea6\u5462\uff1f<\/p>\n<p>\u7b54\u6848\u662f\u80af\u5b9a\u7684\uff0c\u8fd9\u5c31\u662f\u8def\u5f84\u538b\u7f29\uff0c\u5373\u5f53\u6211\u4eec\u7ecf\u8fc7\"\u9012\u63a8\"\u627e\u5230\u7956\u5148\u8282\u70b9\u540e\uff0c\"\u56de\u5f52\"\u7684\u65f6\u5019\u987a\u4fbf\u5c06\u5b83\u7684\u5b50\u5b59\u8282\u70b9\u90fd\u76f4\u63a5\u6307\u5411\u7956\u5148\uff0c\u8fd9\u6837\u4ee5\u540e\u518d\u6b21Find_Set(x)\u65f6\u590d\u6742\u5ea6\u5c31\u53d8\u6210O(1)\u4e86\u3002<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-816\" title=\"\u8def\u5f84\u538b\u7f29\" src=\"http:\/\/www.slyar.com\/blog\/wp-content\/uploads\/2009\/06\/path-compression.jpg\" alt=\"\u8def\u5f84\u538b\u7f29\" width=\"458\" height=\"203\" srcset=\"http:\/\/www.slyar.com\/blog\/wp-content\/uploads\/2009\/06\/path-compression.jpg 458w, http:\/\/www.slyar.com\/blog\/wp-content\/uploads\/2009\/06\/path-compression-150x66.jpg 150w, http:\/\/www.slyar.com\/blog\/wp-content\/uploads\/2009\/06\/path-compression-300x133.jpg 300w\" sizes=\"auto, (max-width: 458px) 100vw, 458px\" \/><\/p>\n<p><span style=\"color: #0000ff;\">2\u3001Union(x,y)\u65f6 \u6309\u79e9\u5408\u5e76<\/span><\/p>\n<p>\u5373\u5408\u5e76\u7684\u65f6\u5019\u5c06\u5143\u7d20\u5c11\u7684\u96c6\u5408\u5408\u5e76\u5230\u5143\u7d20\u591a\u7684\u96c6\u5408\u4e2d\uff0c\u8fd9\u6837\u5408\u5e76\u4e4b\u540e\u6811\u7684\u9ad8\u5ea6\u4f1a\u76f8\u5bf9\u8f83\u5c0f\u3002<\/p>\n<p><strong>\u4e3b\u8981\u4ee3\u7801\u5b9e\u73b0<\/strong><\/p>\n<pre lang=\"c\" line=\"1\">\r\n\/* father[x]\u8868\u793ax\u7684\u7236\u8282\u70b9 *\/\r\nint father[MAX];\r\n\/* rank[x]\u8868\u793ax\u7684\u79e9 *\/\r\nint rank[MAX];\r\n<\/pre>\n<pre lang=\"c\" line=\"1\">\r\n\/* \u521d\u59cb\u5316\u96c6\u5408 *\/\r\nvoid Make_Set(int x)\r\n{\r\n\tfather[x] = x;\r\n\trank[x] = 0;\r\n}\r\n<\/pre>\n<pre lang=\"c\" line=\"1\">\r\n\/* \u67e5\u627ex\u5143\u7d20\u6240\u5728\u7684\u96c6\u5408,\u56de\u6eaf\u65f6\u538b\u7f29\u8def\u5f84 *\/\r\nint Find_Set(int x)\r\n{\r\n\tif (x != father[x])\r\n\t{\r\n\t\tfather[x] = Find_Set(father[x]);\r\n\t}\r\n\treturn father[x];\r\n}\r\n<\/pre>\n<pre lang=\"c\" line=\"1\">\r\n\/* \u6309\u79e9\u5408\u5e76x,y\u6240\u5728\u7684\u96c6\u5408 *\/\r\nvoid Union(int x, int y)\r\n{\r\n\tx = Find_Set(x);\r\n\ty = Find_Set(y);\r\n\tif (x == y) return;\r\n\tif (rank[x] > rank[y])\r\n\t{\r\n\t\tfather[y] = x;\r\n\t}\r\n\telse\r\n\t{\r\n\t\tif (rank[x] == rank[y])\r\n\t\t{\r\n\t\t\trank[y]++;\r\n\t\t}\r\n\t\tfather[x] = y;\r\n\t}\r\n}\r\n<\/pre>\n<p><strong>\u76f8\u5173\u9898\u76ee<\/strong><\/p>\n<p>\u5e76\u67e5\u96c6\u7684\u57fa\u7840\u5e94\u7528:<\/p>\n<p><a href=\"http:\/\/www.slyar.com\/blog\/poj-1611-c.html\" target=\"_blank\">POJ 1611 The Suspects C\u8bed\u8a00\u7248<\/a><\/p>\n<p><a href=\"http:\/\/www.slyar.com\/blog\/poj-2524-c.html\" target=\"_blank\">POJ 2524 Ubiquitous Religions C\u8bed\u8a00\u7248<\/a><\/p>\n<p><a href=\"http:\/\/www.slyar.com\/blog\/poj-1182-c.html\" target=\"_blank\">POJ 1182 \u98df\u7269\u94fe C\u8bed\u8a00\u7248<\/a><\/p>\n<p>\u6700\u5c0f\u751f\u6210\u6811Kruskal\u7b97\u6cd5\u5e76\u67e5\u96c6\u5e94\u7528:<\/p>\n<p><a href=\"http:\/\/www.slyar.com\/blog\/poj-1258-kruskal-c.html\" target=\"_blank\">POJ 1258 Agri-Net C\u8bed\u8a00\u7248 Kruskal<\/a><\/p>\n<p><a href=\"http:\/\/www.slyar.com\/blog\/poj-1251-kruskal-cpp.html\" target=\"_blank\">POJ 1251 Jungle Roads C++\u7248 Kruskal<\/a><\/p>\n<p><a href=\"http:\/\/www.slyar.com\/blog\/poj-1861-kruskal-c.html\" target=\"_blank\">POJ 1861 Network C\u8bed\u8a00\u7248 Kruskal<\/a><\/p>\n<p>\u8f6c\u8f7d\u8bf7\u6ce8\u660e\uff1a<a href=\"http:\/\/www.slyar.com\/blog\">Slyar Home<\/a> &raquo; <a href=\"http:\/\/www.slyar.com\/blog\/disjoint-set.html\">\u4e0d\u76f8\u4ea4\u96c6\u5408 - \u5e76\u67e5\u96c6<\/a><\/p>","protected":false},"excerpt":{"rendered":"<p>\u6587\u7ae0\u4f5c\u8005\uff1a\u59dc\u5357(Slyar) \u6587\u7ae0\u6765\u6e90\uff1aSlyar Home (www.slyar.com) \u8f6c\u8f7d\u8bf7\u6ce8\u660e\uff0c\u8c22\u8c22\u5408\u4f5c\u3002 \u6069\uff0c\u524d\u4e24\u5468\u5b66\u4e60\u4e86\u5e76\u67e5\u96c6\uff0c\u662f\u65f6\u5019\u603b\u7ed3\u4e00\u4e0b\u4e86\u3002 \u7b49\u4ef7\u5173\u7cfb\u4e0e\u7b49\u4ef7\u7c7b \u4ece\u6570\u5b66\u4e0a\u770b\uff0c\u7b49\u4ef7\u7c7b\u662f\u4e00\u4e2a\u5bf9\u8c61(\u6216\u6210\u5458)\u7684\u96c6\u5408\uff0c\u5728\u6b64\u96c6\u5408\u4e2d\u7684\u6240\u6709\u5bf9\u8c61\u5e94\u6ee1 [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[17],"tags":[913,258],"class_list":["post-813","post","type-post","status-publish","format-standard","hentry","category-programing","tag-913","tag-258"],"aioseo_notices":[],"aioseo_head":"\n\t\t<!-- All in One SEO 5.0.2.1 - aioseo.com -->\n\t<meta name=\"description\" content=\"\u603b\u7ed3\u4e0d\u76f8\u4ea4\u96c6\u5408 - \u5e76\u67e5\u96c6\u7684\u76f8\u5173\u6982\u5ff5\u4ee5\u53ca\u5e94\u7528\u3002\" \/>\n\t<meta name=\"robots\" content=\"max-image-preview:large\" \/>\n\t<meta name=\"author\" content=\"Slyar\"\/>\n\t<meta name=\"keywords\" content=\"slyar,\u5e76\u67e5\u96c6,\u4e0d\u76f8\u4ea4\u96c6\u5408,\u6570\u636e\u7ed3\u6784,unionfind,set,find,reset,\u6811,\u96c6\u5408,\u8282\u70b9,\u68ee\u6797,\u4f20\u9012\" \/>\n\t<link rel=\"canonical\" href=\"http:\/\/www.slyar.com\/blog\/disjoint-set.html\" \/>\n\t<meta name=\"generator\" content=\"All in One SEO (AIOSEO) 5.0.2.1\" \/>\n\t\t<meta property=\"og:locale\" content=\"zh_CN\" \/>\n\t\t<meta property=\"og:site_name\" content=\"Slyar Home | \u8bb0\u5f55\u4e2a\u4eba\u751f\u6d3b\" \/>\n\t\t<meta property=\"og:type\" content=\"article\" \/>\n\t\t<meta property=\"og:title\" content=\"\u4e0d\u76f8\u4ea4\u96c6\u5408 - \u5e76\u67e5\u96c6 - Slyar Home\" \/>\n\t\t<meta property=\"og:description\" content=\"\u603b\u7ed3\u4e0d\u76f8\u4ea4\u96c6\u5408 - \u5e76\u67e5\u96c6\u7684\u76f8\u5173\u6982\u5ff5\u4ee5\u53ca\u5e94\u7528\u3002\" \/>\n\t\t<meta property=\"og:url\" content=\"http:\/\/www.slyar.com\/blog\/disjoint-set.html\" \/>\n\t\t<meta property=\"article:published_time\" content=\"2009-06-14T05:25:33+00:00\" \/>\n\t\t<meta property=\"article:modified_time\" content=\"2014-04-22T05:50:23+00:00\" \/>\n\t\t<meta name=\"twitter:card\" content=\"summary\" \/>\n\t\t<meta name=\"twitter:title\" content=\"\u4e0d\u76f8\u4ea4\u96c6\u5408 - \u5e76\u67e5\u96c6 - Slyar Home\" \/>\n\t\t<meta name=\"twitter:description\" content=\"\u603b\u7ed3\u4e0d\u76f8\u4ea4\u96c6\u5408 - \u5e76\u67e5\u96c6\u7684\u76f8\u5173\u6982\u5ff5\u4ee5\u53ca\u5e94\u7528\u3002\" \/>\n\t\t<script type=\"application\/ld+json\" class=\"aioseo-schema\">\n\t\t\t{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"http:\\\/\\\/www.slyar.com\\\/blog\\\/disjoint-set.html#article\",\"name\":\"\\u4e0d\\u76f8\\u4ea4\\u96c6\\u5408 - \\u5e76\\u67e5\\u96c6 - Slyar Home\",\"headline\":\"\\u4e0d\\u76f8\\u4ea4\\u96c6\\u5408 - \\u5e76\\u67e5\\u96c6\",\"author\":{\"@id\":\"http:\\\/\\\/www.slyar.com\\\/blog\\\/author\\\/slyar#author\"},\"publisher\":{\"@id\":\"http:\\\/\\\/www.slyar.com\\\/blog\\\/#person\"},\"image\":{\"@type\":\"ImageObject\",\"url\":\"http:\\\/\\\/www.slyar.com\\\/blog\\\/wp-content\\\/uploads\\\/2009\\\/06\\\/lights.gif\",\"@id\":\"http:\\\/\\\/www.slyar.com\\\/blog\\\/disjoint-set.html\\\/#articleImage\",\"width\":200,\"height\":100},\"datePublished\":\"2009-06-14T13:25:33-07:00\",\"dateModified\":\"2014-04-22T13:50:23-07:00\",\"inLanguage\":\"zh-CN\",\"commentCount\":10,\"mainEntityOfPage\":{\"@id\":\"http:\\\/\\\/www.slyar.com\\\/blog\\\/disjoint-set.html#webpage\"},\"isPartOf\":{\"@id\":\"http:\\\/\\\/www.slyar.com\\\/blog\\\/disjoint-set.html#webpage\"},\"articleSection\":\"\\u7f16\\u7a0b\\u76f8\\u5173, \\u5e76\\u67e5\\u96c6, \\u7b97\\u6cd5\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"http:\\\/\\\/www.slyar.com\\\/blog\\\/disjoint-set.html#breadcrumblist\",\"itemListElement\":[{\"@type\":\"ListItem\",\"@id\":\"http:\\\/\\\/www.slyar.com\\\/blog\\\/#listItem\",\"position\":1,\"name\":\"Home\",\"item\":\"http:\\\/\\\/www.slyar.com\\\/blog\\\/\",\"nextItem\":{\"@type\":\"ListItem\",\"@id\":\"http:\\\/\\\/www.slyar.com\\\/blog\\\/category\\\/programing#listItem\",\"name\":\"\\u7f16\\u7a0b\\u76f8\\u5173\"}},{\"@type\":\"ListItem\",\"@id\":\"http:\\\/\\\/www.slyar.com\\\/blog\\\/category\\\/programing#listItem\",\"position\":2,\"name\":\"\\u7f16\\u7a0b\\u76f8\\u5173\",\"item\":\"http:\\\/\\\/www.slyar.com\\\/blog\\\/category\\\/programing\",\"nextItem\":{\"@type\":\"ListItem\",\"@id\":\"http:\\\/\\\/www.slyar.com\\\/blog\\\/disjoint-set.html#listItem\",\"name\":\"\\u4e0d\\u76f8\\u4ea4\\u96c6\\u5408 - \\u5e76\\u67e5\\u96c6\"},\"previousItem\":{\"@type\":\"ListItem\",\"@id\":\"http:\\\/\\\/www.slyar.com\\\/blog\\\/#listItem\",\"name\":\"Home\"}},{\"@type\":\"ListItem\",\"@id\":\"http:\\\/\\\/www.slyar.com\\\/blog\\\/disjoint-set.html#listItem\",\"position\":3,\"name\":\"\\u4e0d\\u76f8\\u4ea4\\u96c6\\u5408 - \\u5e76\\u67e5\\u96c6\",\"previousItem\":{\"@type\":\"ListItem\",\"@id\":\"http:\\\/\\\/www.slyar.com\\\/blog\\\/category\\\/programing#listItem\",\"name\":\"\\u7f16\\u7a0b\\u76f8\\u5173\"}}]},{\"@type\":\"Person\",\"@id\":\"http:\\\/\\\/www.slyar.com\\\/blog\\\/#person\",\"name\":\"Slyar\",\"image\":{\"@type\":\"ImageObject\",\"@id\":\"http:\\\/\\\/www.slyar.com\\\/blog\\\/disjoint-set.html#personImage\",\"url\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/fa995532c4fa6a1a16430db283689338da430a677b2ff974e0cad68e3bba05c4?s=96&d=monsterid\",\"width\":96,\"height\":96,\"caption\":\"Slyar\"}},{\"@type\":\"Person\",\"@id\":\"http:\\\/\\\/www.slyar.com\\\/blog\\\/author\\\/slyar#author\",\"url\":\"http:\\\/\\\/www.slyar.com\\\/blog\\\/author\\\/slyar\",\"name\":\"Slyar\",\"image\":{\"@type\":\"ImageObject\",\"@id\":\"http:\\\/\\\/www.slyar.com\\\/blog\\\/disjoint-set.html#authorImage\",\"url\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/fa995532c4fa6a1a16430db283689338da430a677b2ff974e0cad68e3bba05c4?s=96&d=monsterid\",\"width\":96,\"height\":96,\"caption\":\"Slyar\"}},{\"@type\":\"WebPage\",\"@id\":\"http:\\\/\\\/www.slyar.com\\\/blog\\\/disjoint-set.html#webpage\",\"url\":\"http:\\\/\\\/www.slyar.com\\\/blog\\\/disjoint-set.html\",\"name\":\"\\u4e0d\\u76f8\\u4ea4\\u96c6\\u5408 - \\u5e76\\u67e5\\u96c6 - Slyar Home\",\"description\":\"\\u603b\\u7ed3\\u4e0d\\u76f8\\u4ea4\\u96c6\\u5408 - \\u5e76\\u67e5\\u96c6\\u7684\\u76f8\\u5173\\u6982\\u5ff5\\u4ee5\\u53ca\\u5e94\\u7528\\u3002\",\"inLanguage\":\"zh-CN\",\"isPartOf\":{\"@id\":\"http:\\\/\\\/www.slyar.com\\\/blog\\\/#website\"},\"breadcrumb\":{\"@id\":\"http:\\\/\\\/www.slyar.com\\\/blog\\\/disjoint-set.html#breadcrumblist\"},\"author\":{\"@id\":\"http:\\\/\\\/www.slyar.com\\\/blog\\\/author\\\/slyar#author\"},\"creator\":{\"@id\":\"http:\\\/\\\/www.slyar.com\\\/blog\\\/author\\\/slyar#author\"},\"datePublished\":\"2009-06-14T13:25:33-07:00\",\"dateModified\":\"2014-04-22T13:50:23-07:00\"},{\"@type\":\"WebSite\",\"@id\":\"http:\\\/\\\/www.slyar.com\\\/blog\\\/#website\",\"url\":\"http:\\\/\\\/www.slyar.com\\\/blog\\\/\",\"name\":\"Slyar Home\",\"description\":\"\\u8bb0\\u5f55\\u4e2a\\u4eba\\u751f\\u6d3b\",\"inLanguage\":\"zh-CN\",\"publisher\":{\"@id\":\"http:\\\/\\\/www.slyar.com\\\/blog\\\/#person\"}}]}\n\t\t<\/script>\n\t\t<!-- All in One SEO -->\n\n","aioseo_head_json":{"title":"\u4e0d\u76f8\u4ea4\u96c6\u5408 - \u5e76\u67e5\u96c6 - Slyar Home","description":"\u603b\u7ed3\u4e0d\u76f8\u4ea4\u96c6\u5408 - \u5e76\u67e5\u96c6\u7684\u76f8\u5173\u6982\u5ff5\u4ee5\u53ca\u5e94\u7528\u3002","canonical_url":"http:\/\/www.slyar.com\/blog\/disjoint-set.html","robots":"max-image-preview:large","keywords":"slyar,\u5e76\u67e5\u96c6,\u4e0d\u76f8\u4ea4\u96c6\u5408,\u6570\u636e\u7ed3\u6784,unionfind,set,find,reset,\u6811,\u96c6\u5408,\u8282\u70b9,\u68ee\u6797,\u4f20\u9012","webmasterTools":{"miscellaneous":""},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"http:\/\/www.slyar.com\/blog\/disjoint-set.html#article","name":"\u4e0d\u76f8\u4ea4\u96c6\u5408 - \u5e76\u67e5\u96c6 - Slyar Home","headline":"\u4e0d\u76f8\u4ea4\u96c6\u5408 - \u5e76\u67e5\u96c6","author":{"@id":"http:\/\/www.slyar.com\/blog\/author\/slyar#author"},"publisher":{"@id":"http:\/\/www.slyar.com\/blog\/#person"},"image":{"@type":"ImageObject","url":"http:\/\/www.slyar.com\/blog\/wp-content\/uploads\/2009\/06\/lights.gif","@id":"http:\/\/www.slyar.com\/blog\/disjoint-set.html\/#articleImage","width":200,"height":100},"datePublished":"2009-06-14T13:25:33-07:00","dateModified":"2014-04-22T13:50:23-07:00","inLanguage":"zh-CN","commentCount":10,"mainEntityOfPage":{"@id":"http:\/\/www.slyar.com\/blog\/disjoint-set.html#webpage"},"isPartOf":{"@id":"http:\/\/www.slyar.com\/blog\/disjoint-set.html#webpage"},"articleSection":"\u7f16\u7a0b\u76f8\u5173, \u5e76\u67e5\u96c6, \u7b97\u6cd5"},{"@type":"BreadcrumbList","@id":"http:\/\/www.slyar.com\/blog\/disjoint-set.html#breadcrumblist","itemListElement":[{"@type":"ListItem","@id":"http:\/\/www.slyar.com\/blog\/#listItem","position":1,"name":"Home","item":"http:\/\/www.slyar.com\/blog\/","nextItem":{"@type":"ListItem","@id":"http:\/\/www.slyar.com\/blog\/category\/programing#listItem","name":"\u7f16\u7a0b\u76f8\u5173"}},{"@type":"ListItem","@id":"http:\/\/www.slyar.com\/blog\/category\/programing#listItem","position":2,"name":"\u7f16\u7a0b\u76f8\u5173","item":"http:\/\/www.slyar.com\/blog\/category\/programing","nextItem":{"@type":"ListItem","@id":"http:\/\/www.slyar.com\/blog\/disjoint-set.html#listItem","name":"\u4e0d\u76f8\u4ea4\u96c6\u5408 - \u5e76\u67e5\u96c6"},"previousItem":{"@type":"ListItem","@id":"http:\/\/www.slyar.com\/blog\/#listItem","name":"Home"}},{"@type":"ListItem","@id":"http:\/\/www.slyar.com\/blog\/disjoint-set.html#listItem","position":3,"name":"\u4e0d\u76f8\u4ea4\u96c6\u5408 - \u5e76\u67e5\u96c6","previousItem":{"@type":"ListItem","@id":"http:\/\/www.slyar.com\/blog\/category\/programing#listItem","name":"\u7f16\u7a0b\u76f8\u5173"}}]},{"@type":"Person","@id":"http:\/\/www.slyar.com\/blog\/#person","name":"Slyar","image":{"@type":"ImageObject","@id":"http:\/\/www.slyar.com\/blog\/disjoint-set.html#personImage","url":"https:\/\/secure.gravatar.com\/avatar\/fa995532c4fa6a1a16430db283689338da430a677b2ff974e0cad68e3bba05c4?s=96&d=monsterid","width":96,"height":96,"caption":"Slyar"}},{"@type":"Person","@id":"http:\/\/www.slyar.com\/blog\/author\/slyar#author","url":"http:\/\/www.slyar.com\/blog\/author\/slyar","name":"Slyar","image":{"@type":"ImageObject","@id":"http:\/\/www.slyar.com\/blog\/disjoint-set.html#authorImage","url":"https:\/\/secure.gravatar.com\/avatar\/fa995532c4fa6a1a16430db283689338da430a677b2ff974e0cad68e3bba05c4?s=96&d=monsterid","width":96,"height":96,"caption":"Slyar"}},{"@type":"WebPage","@id":"http:\/\/www.slyar.com\/blog\/disjoint-set.html#webpage","url":"http:\/\/www.slyar.com\/blog\/disjoint-set.html","name":"\u4e0d\u76f8\u4ea4\u96c6\u5408 - \u5e76\u67e5\u96c6 - Slyar Home","description":"\u603b\u7ed3\u4e0d\u76f8\u4ea4\u96c6\u5408 - \u5e76\u67e5\u96c6\u7684\u76f8\u5173\u6982\u5ff5\u4ee5\u53ca\u5e94\u7528\u3002","inLanguage":"zh-CN","isPartOf":{"@id":"http:\/\/www.slyar.com\/blog\/#website"},"breadcrumb":{"@id":"http:\/\/www.slyar.com\/blog\/disjoint-set.html#breadcrumblist"},"author":{"@id":"http:\/\/www.slyar.com\/blog\/author\/slyar#author"},"creator":{"@id":"http:\/\/www.slyar.com\/blog\/author\/slyar#author"},"datePublished":"2009-06-14T13:25:33-07:00","dateModified":"2014-04-22T13:50:23-07:00"},{"@type":"WebSite","@id":"http:\/\/www.slyar.com\/blog\/#website","url":"http:\/\/www.slyar.com\/blog\/","name":"Slyar Home","description":"\u8bb0\u5f55\u4e2a\u4eba\u751f\u6d3b","inLanguage":"zh-CN","publisher":{"@id":"http:\/\/www.slyar.com\/blog\/#person"}}]},"og:locale":"zh_CN","og:site_name":"Slyar Home | \u8bb0\u5f55\u4e2a\u4eba\u751f\u6d3b","og:type":"article","og:title":"\u4e0d\u76f8\u4ea4\u96c6\u5408 - \u5e76\u67e5\u96c6 - Slyar Home","og:description":"\u603b\u7ed3\u4e0d\u76f8\u4ea4\u96c6\u5408 - \u5e76\u67e5\u96c6\u7684\u76f8\u5173\u6982\u5ff5\u4ee5\u53ca\u5e94\u7528\u3002","og:url":"http:\/\/www.slyar.com\/blog\/disjoint-set.html","article:published_time":"2009-06-14T05:25:33+00:00","article:modified_time":"2014-04-22T05:50:23+00:00","twitter:card":"summary","twitter:title":"\u4e0d\u76f8\u4ea4\u96c6\u5408 - \u5e76\u67e5\u96c6 - Slyar Home","twitter:description":"\u603b\u7ed3\u4e0d\u76f8\u4ea4\u96c6\u5408 - \u5e76\u67e5\u96c6\u7684\u76f8\u5173\u6982\u5ff5\u4ee5\u53ca\u5e94\u7528\u3002"},"aioseo_meta_data":{"post_id":"813","title":"\u4e0d\u76f8\u4ea4\u96c6\u5408 - \u5e76\u67e5\u96c6 - #site_title","description":"\u603b\u7ed3\u4e0d\u76f8\u4ea4\u96c6\u5408 - \u5e76\u67e5\u96c6\u7684\u76f8\u5173\u6982\u5ff5\u4ee5\u53ca\u5e94\u7528\u3002","keywords":[{"label":"slyar","value":"slyar"},{"label":"\u5e76\u67e5\u96c6","value":"\u5e76\u67e5\u96c6"},{"label":"\u4e0d\u76f8\u4ea4\u96c6\u5408","value":"\u4e0d\u76f8\u4ea4\u96c6\u5408"},{"label":"\u6570\u636e\u7ed3\u6784","value":"\u6570\u636e\u7ed3\u6784"},{"label":"UnionFind","value":"UnionFind"},{"label":"set","value":"set"},{"label":"find","value":"find"},{"label":"reset","value":"reset"},{"label":"\u6811","value":"\u6811"},{"label":"\u96c6\u5408","value":"\u96c6\u5408"},{"label":"\u8282\u70b9","value":"\u8282\u70b9"},{"label":"\u68ee\u6797","value":"\u68ee\u6797"},{"label":"\u4f20\u9012","value":"\u4f20\u9012"}],"keyphrases":null,"primary_term":null,"canonical_url":null,"og_title":null,"og_description":null,"og_object_type":"default","og_image_type":"default","og_image_url":null,"og_image_width":null,"og_image_height":null,"og_image_custom_url":null,"og_image_custom_fields":null,"og_video":null,"og_custom_url":null,"og_article_section":null,"og_article_tags":null,"twitter_use_og":false,"twitter_card":"default","twitter_image_type":"default","twitter_image_url":null,"twitter_image_custom_url":null,"twitter_image_custom_fields":null,"twitter_title":null,"twitter_description":null,"schema":{"blockGraphs":[],"customGraphs":[],"default":{"data":{"Article":[],"Course":[],"Dataset":[],"FAQPage":[],"Movie":[],"Person":[],"Product":[],"ProductReview":[],"Car":[],"Recipe":[],"Service":[],"SoftwareApplication":[],"WebPage":[]},"graphName":"","isEnabled":true},"graphs":[]},"schema_type":null,"schema_type_options":null,"pillar_content":false,"robots_default":true,"robots_noindex":false,"robots_noarchive":false,"robots_nosnippet":false,"robots_nofollow":false,"robots_noimageindex":false,"robots_noodp":false,"robots_notranslate":false,"robots_max_snippet":null,"robots_max_videopreview":null,"robots_max_imagepreview":"large","priority":null,"frequency":null,"local_seo":null,"breadcrumb_settings":null,"limit_modified_date":false,"ai":null,"created":"2021-02-10 02:43:25","updated":"2022-10-18 12:49:18","seo_analyzer_scan_date":null,"focus_keyword":null,"additional_keywords":null,"truseo_locale":null},"_links":{"self":[{"href":"http:\/\/www.slyar.com\/blog\/wp-json\/wp\/v2\/posts\/813","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/www.slyar.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/www.slyar.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/www.slyar.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/www.slyar.com\/blog\/wp-json\/wp\/v2\/comments?post=813"}],"version-history":[{"count":0,"href":"http:\/\/www.slyar.com\/blog\/wp-json\/wp\/v2\/posts\/813\/revisions"}],"wp:attachment":[{"href":"http:\/\/www.slyar.com\/blog\/wp-json\/wp\/v2\/media?parent=813"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/www.slyar.com\/blog\/wp-json\/wp\/v2\/categories?post=813"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/www.slyar.com\/blog\/wp-json\/wp\/v2\/tags?post=813"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}