{"format":"brushup-mindmap-v1","id":"ds-00-sheet5","title":"第六章 图","structure":"timeline-h","theme":"auto","root":{"id":"a2bb705901eb35d8cb04493407","topic":"第六章 图","expanded":false,"children":[{"id":"ff7aa9a13ee832ccb7c18819c3","topic":"图的定义","expanded":true,"children":[{"id":"0d4bb47ec79bf9e6fbaf0bbbda","topic":"序偶ordered pair","expanded":true,"children":[{"id":"31f8258396d9fff63b74c8e017","topic":"有序偶：有序边","expanded":true,"children":[{"id":"b3e90f26639b94168638d8d91f","topic":"就是有两个点AB，的<A, B>","expanded":true}]},{"id":"958bc2450268ea3d68d2f962cd","topic":"无序偶：无序边","expanded":true,"children":[{"id":"799b137dc708c7f0cc9c397e50","topic":"两个点AB，的(A, B)","expanded":true}]}]},{"id":"1d7b5dc229fb266116ce49b99a","topic":"各种各样的图","expanded":true,"children":[{"id":"899dd2d4-cf61-4695-8612-4be6c3861909","topic":"表示","expanded":true,"children":[{"id":"c222470f-af59-4caf-a33a-17bdf3649589","topic":"","expanded":true,"children":[{"id":"35a53e7d-0629-4a7b-8fd4-e5a2dd3383fe","topic":"有向边","expanded":true,"children":[{"id":"9a54f388-e30a-4395-abcd-791a9fec16b1","topic":"","expanded":true,"formula":{"tex":"E = \\{<1, 2>, <2, 3>\\}","displayMode":true,"mathml":"<span class=\"katex\"><math xmlns=\"http://www.w3.org/1998/Math/MathML\" display=\"block\"><semantics><mrow><mi>E</mi><mo>=</mo><mo stretchy=\"false\">{</mo><mo>&lt;</mo><mn>1</mn><mo separator=\"true\">,</mo><mn>2</mn><mo>&gt;</mo><mo separator=\"true\">,</mo><mo>&lt;</mo><mn>2</mn><mo separator=\"true\">,</mo><mn>3</mn><mo>&gt;</mo><mo stretchy=\"false\">}</mo></mrow><annotation encoding=\"application/x-tex\">E = \\{&lt;1, 2&gt;, &lt;2, 3&gt;\\}</annotation></semantics></math></span>"}}]},{"id":"026a55c0-43c6-43e6-a7c5-26e0cc52fcec","topic":"无向边","expanded":true,"children":[{"id":"b07cc3fa-d17d-4388-aaf5-79069f1c8a2b","topic":"","expanded":true,"formula":{"tex":"E = \\{(1, 2), (2, 4)\\}","displayMode":true,"mathml":"<span class=\"katex\"><math xmlns=\"http://www.w3.org/1998/Math/MathML\" display=\"block\"><semantics><mrow><mi>E</mi><mo>=</mo><mo stretchy=\"false\">{</mo><mo stretchy=\"false\">(</mo><mn>1</mn><mo separator=\"true\">,</mo><mn>2</mn><mo stretchy=\"false\">)</mo><mo separator=\"true\">,</mo><mo stretchy=\"false\">(</mo><mn>2</mn><mo separator=\"true\">,</mo><mn>4</mn><mo stretchy=\"false\">)</mo><mo stretchy=\"false\">}</mo></mrow><annotation encoding=\"application/x-tex\">E = \\{(1, 2), (2, 4)\\}</annotation></semantics></math></span>"}}]}],"formula":{"tex":"G = (V, E)","displayMode":true,"mathml":"<span class=\"katex\"><math xmlns=\"http://www.w3.org/1998/Math/MathML\" display=\"block\"><semantics><mrow><mi>G</mi><mo>=</mo><mo stretchy=\"false\">(</mo><mi>V</mi><mo separator=\"true\">,</mo><mi>E</mi><mo stretchy=\"false\">)</mo></mrow><annotation encoding=\"application/x-tex\">G = (V, E)</annotation></semantics></math></span>"}}]},{"id":"d659f07d91487254356dbb0bec","topic":"有向图","expanded":true,"children":[{"id":"22ba027836e98871a38ab8c956","topic":"无向图","expanded":true,"children":[{"id":"5688d2db860aa8be1a831abe97","topic":"简单图","expanded":true,"children":[{"id":"4678fedab77b150e7027ab2cde","topic":"完全图","expanded":true,"children":[{"id":"c73b4fbb05dbb6360abed95607","topic":"子图","expanded":true,"children":[{"id":"940ad75c64daa301c889fa0c3d","topic":"入度、出度","expanded":true}]}]}]}]}]},{"id":"fabb26c469f883d3173ef929ad","topic":"简单图：","expanded":true,"image":{"src":"https://gastigado.cnies.org/d/BrushUP/mm-95f91ea306edc4.png","width":323,"height":259},"children":[{"id":"f3b968737f986d65a7ee0bf8be","topic":"不存在顶点到其自身的边，且同一条边不重复出现","expanded":true},{"id":"150226d0-5415-43d0-9382-4cdbb5705c75","topic":"举例：有向图第一个是。无向图第一个是。","expanded":true}]},{"id":"3a18156fb2c9163308b3489fe7","topic":"完全图（简单完全图）：每两个顶点都可以路径为一的方式互通","expanded":true,"image":{"src":"https://gastigado.cnies.org/d/BrushUP/mm-70620841f9ee27.png","width":234,"height":128},"children":[{"id":"277a5ea0289be38440d8b8a153","topic":"无向图","expanded":true,"formula":{"tex":"n \\text{ 个顶点，有 } C_n^2 = \\frac{n(n-1)}{2} \\text{ 条边}","displayMode":true,"mathml":"<span class=\"katex\"><math xmlns=\"http://www.w3.org/1998/Math/MathML\" display=\"block\"><semantics><mrow><mi>n</mi><mtext> 个顶点，有 </mtext><msubsup><mi>C</mi><mi>n</mi><mn>2</mn></msubsup><mo>=</mo><mfrac><mrow><mi>n</mi><mo stretchy=\"false\">(</mo><mi>n</mi><mo>−</mo><mn>1</mn><mo stretchy=\"false\">)</mo></mrow><mn>2</mn></mfrac><mtext> 条边</mtext></mrow><annotation encoding=\"application/x-tex\">n \\text{ 个顶点，有 } C_n^2 = \\frac{n(n-1)}{2} \\text{ 条边}</annotation></semantics></math></span>"}},{"id":"d8e474d4-3a1c-47b2-97cc-6b38feb825ca","topic":"有向图","expanded":true,"formula":{"tex":"n \\text{ 个顶点，有 } 2 * C_n^2 = n(n-1) \\text{ 条边}","displayMode":true,"mathml":"<span class=\"katex\"><math xmlns=\"http://www.w3.org/1998/Math/MathML\" display=\"block\"><semantics><mrow><mi>n</mi><mtext> 个顶点，有 </mtext><mn>2</mn><mo>∗</mo><msubsup><mi>C</mi><mi>n</mi><mn>2</mn></msubsup><mo>=</mo><mi>n</mi><mo stretchy=\"false\">(</mo><mi>n</mi><mo>−</mo><mn>1</mn><mo stretchy=\"false\">)</mo><mtext> 条边</mtext></mrow><annotation encoding=\"application/x-tex\">n \\text{ 个顶点，有 } 2 * C_n^2 = n(n-1) \\text{ 条边}</annotation></semantics></math></span>"}}]},{"id":"4e683830bc69f84d53a0abad7e","topic":"子图：","expanded":true,"children":[{"id":"d37983a966c8877794790ad3f1","topic":"从图开始，可以删点和边形成新的图（但是需要保证子图一定是图，至少有一个顶点）","expanded":true,"children":[{"id":"50ea55646788290a305ffac9e9","topic":"但是注意如果E‘中有<A, B>，而V'中且没有A或B节点的话，就说明不是子图（就是一条边，有一边的顶点消失了）","expanded":true},{"id":"02fc149b-0565-4517-bba7-97598bacb226","topic":"关于空图、空树、空表：","expanded":true,"children":[{"id":"0311820f-2ef2-47d5-a559-102617062187","topic":"空表（线性表中没有元素），空树（没有结点），空图（也称为无边图，没有边，有节点）。","expanded":true},{"id":"a3ac29d5-6634-4adc-aadb-b1eab5826212","topic":"图中不能一个顶点也没有，图的顶点集V一定非空，但是边集E可以为空，此时图中只有顶点而没有边。","expanded":true}]}],"formula":{"tex":"\\text{图为 } G = (V, E)\\text{，子图为 } G' = (V', E')\\text{，其中 } V' \\subseteq V, E' \\subseteq E\\text{。}","displayMode":true,"mathml":"<span class=\"katex\"><math xmlns=\"http://www.w3.org/1998/Math/MathML\" display=\"block\"><semantics><mrow><mtext>图为 </mtext><mi>G</mi><mo>=</mo><mo stretchy=\"false\">(</mo><mi>V</mi><mo separator=\"true\">,</mo><mi>E</mi><mo stretchy=\"false\">)</mo><mtext>，子图为 </mtext><msup><mi>G</mi><mo mathvariant=\"normal\" lspace=\"0em\" rspace=\"0em\">′</mo></msup><mo>=</mo><mo stretchy=\"false\">(</mo><msup><mi>V</mi><mo mathvariant=\"normal\" lspace=\"0em\" rspace=\"0em\">′</mo></msup><mo separator=\"true\">,</mo><msup><mi>E</mi><mo mathvariant=\"normal\" lspace=\"0em\" rspace=\"0em\">′</mo></msup><mo stretchy=\"false\">)</mo><mtext>，其中 </mtext><msup><mi>V</mi><mo mathvariant=\"normal\" lspace=\"0em\" rspace=\"0em\">′</mo></msup><mo>⊆</mo><mi>V</mi><mo separator=\"true\">,</mo><msup><mi>E</mi><mo mathvariant=\"normal\" lspace=\"0em\" rspace=\"0em\">′</mo></msup><mo>⊆</mo><mi>E</mi><mtext>。</mtext></mrow><annotation encoding=\"application/x-tex\">\\text{图为 } G = (V, E)\\text{，子图为 } G&#x27; = (V&#x27;, E&#x27;)\\text{，其中 } V&#x27; \\subseteq V, E&#x27; \\subseteq E\\text{。}</annotation></semantics></math></span>"}}]},{"id":"df2ba279a1188faf0df4b8e1ac","topic":"真子图","expanded":true,"children":[{"id":"e009f76422989c68fda2d80332","topic":"同’子图‘，不允许什么都不删","expanded":true}]},{"id":"d9ab11deadc9a13d84f41afd25","topic":"生成子图","expanded":true,"children":[{"id":"54696b2f71baaf003d9fe8264f","topic":"同’子图‘，但是只允许删除边","expanded":true}]},{"id":"2318a80fa3a8dd3cb28fab6c5c","topic":"极小连通子图","expanded":true,"style":{"background":"#F8F7F7"},"children":[{"id":"5fb9451c7e993e3888ef4b5baa","topic":"满足连通的情况下没有多余的边","expanded":true,"style":{"background":"#F8F7F7"}}]}]},{"id":"10ba578e900a3d299ac499f7de","topic":"顶点的度","expanded":true,"children":[{"id":"179b36bc0939b0ec4e287b1788","topic":"有向图","expanded":true,"children":[{"id":"d5db4719e73aa7cce00ccbde03","topic":"顶点的入度和出度之和","expanded":true}]},{"id":"dd7ab4cb007bab0632938b926b","topic":"无向图","expanded":true,"children":[{"id":"321ba8e3fe184e6585bde96ea8","topic":"该顶点相连的边的个数","expanded":true}]}]},{"id":"ef39a9048d7ae8a7d965093337","topic":"简单路径","expanded":true,"style":{"background":"#FFABD5"},"children":[{"id":"adeb511ace2808b5c097ca6857","topic":"顶点不重复的路径","expanded":true,"style":{"background":"#FFABD5"},"children":[{"id":"38685a2cf2597a6091fc48af32","topic":"简单回路","expanded":true,"children":[{"id":"6e6b13afbc5a6a59057c9b46b3","topic":"顶点不重复的回路","expanded":true}]}]}]},{"id":"086aff43913a26f5794608e54a","topic":"无向图","expanded":true,"children":[{"id":"a9fa88aac51ae3e1353f4bb2f8","topic":"连通图","expanded":true,"style":{"background":"#8EDDF9"},"children":[{"id":"f248c3e0ad7805fd7569b9bb11","topic":"图中任意两个顶点之间都有路径可达","expanded":true,"style":{"background":"#8EDDF9"}}]},{"id":"6fd029e9-8be9-4e79-b037-85efec0cfa37","topic":"连通子图","expanded":true,"children":[{"id":"19f32d80-131f-40d4-8553-802bf2415370","topic":"若图的子图是连通图，则称为连通子图","expanded":true}]},{"id":"20f17465-f876-4118-83bd-0a4866ba075a","topic":"极大连通子图","expanded":true,"children":[{"id":"ae8d898f-ab77-46d4-bdd1-7efbc2ad1efc","topic":"极大连通子图是该图中所有连通子图中边数最多的子图","expanded":true},{"id":"e8360b38-3b86-4896-88b1-710f9cd53c59","topic":"连通图的极大连通子图是它本身","expanded":true}]},{"id":"ae9b5376ad797c17fca639ebf5","topic":"连通分量","expanded":true,"style":{"background":"#8EDDF9"},"children":[{"id":"373afe0d224b63be280e0a4c94","topic":"也就是极大连通子图","expanded":true,"style":{"background":"#8EDDF9"},"children":[{"id":"85d9f8c00d5898cbb9eb594209","topic":"图示","expanded":true,"image":{"src":"https://gastigado.cnies.org/d/BrushUP/mm-f9d37a526823cb.png","width":402,"height":159}}]}]}]},{"id":"f4c96ebe-367c-4663-8e3d-85b1ac3d2126","topic":"极大、极小连通子图的关系","expanded":true,"style":{"background":"#8EDDF9"},"children":[{"id":"e839c993-af03-4ecd-b1eb-224e7e43ec82","topic":"无向图+连通+极大连通子图","expanded":true,"children":[{"id":"3130a0ad-9745-4811-90fc-31536e7dfe6e","topic":"自己","expanded":true}]},{"id":"ceb651c4-0157-41a6-a0b7-0685b789d2b2","topic":"无向图+连通+极小连通子图","expanded":true,"children":[{"id":"5412503f-ca2b-40b6-bc7d-3d7c783f5a5d","topic":"自己的生成树","expanded":true}]},{"id":"cf678356-b389-44f5-b805-c542578ceecb","topic":"无向图+不连通+极大连通子图","expanded":true,"children":[{"id":"9adf4c65-13a3-4cd0-8d84-cadb50e6a59d","topic":"有多个，不需要删除点、边","expanded":true}]},{"id":"29ed5d69-3570-4a97-9b25-83887ea1e86c","topic":"无向图+不连通+极小连通子图","expanded":true,"style":{"background":"#F8F7F7"},"children":[{"id":"77d29389-b987-4792-9599-da2f01c3a58f","topic":"上面多个极大连通子图各自的生成树","expanded":true}]}]},{"id":"93ebfde13d09cdd0c0ea48ac13","topic":"有向图","expanded":true,"style":{"background":"#8EDDF9"},"children":[{"id":"c548bab48fa8ee20dec6a883d2","topic":"（强）连通图","expanded":true,"style":{"background":"#F8F7F7"},"children":[{"id":"40e9d566b9ca79a45b08a93bb2","topic":"图中任意两个顶点之间都有路径可达","expanded":true,"style":{"background":"#F8F7F7"}}]},{"id":"f2b90f5f3c5a4860388b982c1f","topic":"（强）连通分量","expanded":true,"style":{"background":"#F8F7F7"},"children":[{"id":"062819328518a43db3d448e5e1","topic":"图中的极大连通子图","expanded":true,"style":{"background":"#F8F7F7"}}]}]},{"id":"f7dac218272871cba1d63a83ca","topic":"无向图连通辨析：","expanded":true,"children":[{"id":"99fe6f7c-5d03-4150-a1f3-dd3aaf23deff","topic":"无向图中：","expanded":true,"children":[{"id":"25160617-b8c1-4804-8203-f3d463dbdbfb","topic":"图示","expanded":true,"image":{"src":"https://gastigado.cnies.org/d/BrushUP/mm-a5c04c918a5410.png","width":284,"height":195},"children":[{"id":"4219ae06-748b-4d37-8785-d07f621872f5","topic":"连通图的子图中有部分是不连通的","expanded":true},{"id":"a8e43ded-1cab-43a8-b9d8-8b09d6bd895e","topic":"极大和极小连通子图是两个概念","expanded":true},{"id":"d5b7b863-06a6-4e1c-98d3-2c0e566b0b29","topic":"在无向连通图中，极小连通子图 = 生成树","expanded":true,"children":[{"id":"2204d897-c57e-4347-8e6b-fd09839a6c21","topic":"如果是无向不连通图，则没有生成树","expanded":true}]},{"id":"9df2e8ce-c973-4594-bcb4-ccce244ff69a","topic":"无向图中，连通分量 = 极大连通子图","expanded":true}]}]},{"id":"8e597183089b449ea674e95a14","topic":"原始图：","expanded":true,"children":[{"id":"dc302c54-de20-4e6e-99bc-1ff579b90f0b","topic":"原本的图","expanded":true}]},{"id":"12d9daa62da986ea203488123b","topic":"子图：","expanded":true,"children":[{"id":"41d940308618cb55def7d8b599","topic":"含有该图中部分边和结点的图，一定是能够形成一个图的“边和结点”集合","expanded":true}]},{"id":"7ab85129215a9bff7bba1a9afa","topic":"连通分量：","expanded":true,"children":[{"id":"6bfa7f8ede6babcbcee21876be","topic":"首先其是子图，就是在该子图的结点对中有所有原始图中的结点对的边，全都要","expanded":true}]},{"id":"a6ca31a1ccd97bb70af709b12e","topic":"生成树：","expanded":true,"children":[{"id":"4f9a949682ebc7a573a2293bbd","topic":"极小连通子图，一定不成环","expanded":true}]},{"id":"3ec8dc6e0a5adbd2bc41d8f56d","topic":"连通分量、生成树的核心区别点","expanded":true,"style":{"background":"#FDD834"},"children":[{"id":"13fad6668e5b0a6b2c3949eef5","topic":"【连通分量】是一定要所有的边都在的，连通分量的概念是图论中为了说明【有多少个】连通分量而存在的","expanded":true,"style":{"background":"#FDD834"},"children":[{"id":"963910ad7d08cee00e24681eaf","topic":"故题中问要求某一个连通分量，只需要求【其中存在的顶点】即可，可以不说明边（建议也说了）","expanded":true,"style":{"background":"#FFABD5"}},{"id":"4bc9826002ca85062febc856f1","topic":"题中一般考察的是一共有【多少个】连通分量，而不会让你用算法【打印出】连通分量","expanded":true,"style":{"background":"#FFABD5"}}]},{"id":"9b381ba8fc69f004689f8b7f4f","topic":"【生成树】一个子图的生成树一定是无环的","expanded":true,"style":{"background":"#FDD834"},"children":[{"id":"d8890480-9823-4386-a87a-472a08fd5616","topic":"生成树一般都不是连通分量（除非原图本来就是一个树）","expanded":true},{"id":"76f8626d-7d75-4c45-b89e-df15f93f42a3","topic":"题目会让你【求】生成树","expanded":true}]},{"id":"7df7077c-5293-49e2-b7de-a1bd77d74516","topic":"故：\nDFS、BFS可以找连通分量✅\nDFS、BFS的结果（生成树）是连通分量❌","expanded":true,"style":{"background":"#8EDDF9"},"children":[{"id":"a9a0ac31-2679-4e46-977d-64b50785ca56","topic":"DFS、BFS的生成树的个数 = 连通分量的个数。通过改进可以打印出连通分量（了解）","expanded":true}]}]}]},{"id":"8009b9fba3a986beb340bb221b","topic":"有向图：","expanded":true,"children":[{"id":"2dc69a8a-522f-4d72-bf03-87f629b846da","topic":"一个例子","expanded":true,"children":[{"id":"644a5c9fb91829968cb8b9f4ed","topic":"图示","expanded":true,"image":{"src":"https://gastigado.cnies.org/d/BrushUP/mm-2697de0315092a.png","width":424,"height":76},"children":[{"id":"739b0492abbb2a962d94eaaf3c","topic":"题干 = 一个有向图存在有环的子图","expanded":true}]},{"id":"b57aa105776aec91acb34b7f0a","topic":"A. 与有无根无关","expanded":true,"children":[{"id":"af448ba8-2fbc-43a6-8a38-c8a70619a5f3","topic":"（从一个结点出发可以抵达所有其他结点）","expanded":true}]},{"id":"0b7b94e0f78bc0c5fcda7979e7","topic":"B. 强连通图","expanded":true,"children":[{"id":"de5bc269dbaadb3a344378b4ea","topic":"强连通图：每对顶点都可以互通，所以起码整个图都得是有环图才行，而现在只是其中部分有环而已","expanded":true,"children":[{"id":"b8c8f08f-fcaa-444a-a75f-3827cfb692f2","topic":"图示","expanded":true,"image":{"src":"https://gastigado.cnies.org/d/BrushUP/mm-07ac0b90da8969.png","width":151,"height":96}}]}]},{"id":"88f9d7a31bb88db0952c6b4a26","topic":"C. 含有多个入度为0的顶点","expanded":true,"children":[{"id":"1fbbfb2bb5fb96c42c65c9d12f","topic":"图示","expanded":true,"image":{"src":"https://gastigado.cnies.org/d/BrushUP/mm-6401884862e26b.png","width":115,"height":80}}]},{"id":"8b6b5027af1b8f735f49f8aa2a","topic":"D. 顶点数大于1的强连通分量","expanded":true,"children":[{"id":"aa69c2736bcbc1caedd93a1596","topic":"D选项 = 有一个顶点数超过1的子图是环","expanded":true}]}]},{"id":"e8fa74b8fe28c0df3d884bfe74","topic":"有向树","expanded":true,"children":[{"id":"561804ece7496a8dd6a5b8393e","topic":"一个顶点的入度为0，其余顶点的入度都是1的有向图","expanded":true,"image":{"src":"https://gastigado.cnies.org/d/BrushUP/mm-312a46666fcaf6.png","width":135,"height":111}}]}]},{"id":"c8fdf925-22dd-4727-beec-5c8b4e207064","topic":"考频：中","expanded":true,"style":{"background":"#FDD834"},"children":[{"id":"d01bb475-d8b1-4128-b5f7-c9f05fb8d4d0","topic":"09、10、11、13、17、22","expanded":true}]}]},{"id":"0b28090cf1cab0ec111f9bb83c","topic":"图的存储结构","expanded":true,"children":[{"id":"96d11416-81bd-4368-8ef7-eb4719af1c0d","topic":"考频：低","expanded":true,"style":{"background":"#8EDDF9"},"children":[{"id":"a143ebb2-0459-488c-b8ef-7a48c732dcf6","topic":"15大、21大","expanded":true}]},{"id":"8fbb56a5372b92530702686426","topic":"邻接矩阵（二维矩阵存储）","expanded":true,"children":[{"id":"07f81c36d5abfe7add1648a504","topic":"稠密图","expanded":true,"children":[{"id":"3095fe25-572b-4a15-8ddb-5aa466b96701","topic":"开辟整个矩阵的空间","expanded":true}]},{"id":"0438b9fd5e4bd1331981188eb8","topic":"找顶点的入度出度要遍历行/列，要O(n)","expanded":true},{"id":"151bc8c706a93f6c9f71ca4c7a","topic":"可以非常快速的定位到两个顶点的边关系","expanded":true},{"id":"f37bdd02204b43f70bb1fa9c16","topic":"取值","expanded":true,"style":{"background":"#FFABD5"},"children":[{"id":"96b2f47c-efc3-4dc3-82ed-570490a9c721","topic":"无向图","expanded":true,"children":[{"id":"7f584def85c8fe7d58d3da71ec","topic":"0","expanded":true,"style":{"background":"#FFABD5"},"children":[{"id":"1d6a68b3b9fb24f83f0eb85c5a","topic":"A[i][j] = A[j][i] = 0，则说明不存在 i 到 j 的边","expanded":true,"style":{"background":"#FFABD5"}}]},{"id":"55848922-8080-4056-a883-25e5606a80de","topic":"1","expanded":true,"style":{"background":"#FFABD5"},"children":[{"id":"c75496cd-bb7a-4d86-b32b-fe46c8bfba78","topic":"A[i][j] = A[j][i] = 1，则说明存在 i 到 j 的边","expanded":true,"style":{"background":"#FFABD5"}}]}]},{"id":"cac1abaa-70e5-4589-80a7-975e59f81227","topic":"有向图","expanded":true,"children":[{"id":"1708811c-71c6-45ca-9ecf-a7550242d14b","topic":"n","expanded":true,"children":[{"id":"d20e4c26-d3a6-41ef-8e3a-b3946ea41100","topic":"A[i][j] = n，则说明从 i 到 j 的边权重为n","expanded":true}]},{"id":"b3f8c75b48db9d5125bc29824c","topic":"0/-1/无穷","expanded":true,"style":{"background":"#FFABD5"},"children":[{"id":"447b263afb4bbce7c1700b4fbc","topic":"对角线（自己到自己）、不存在的边","expanded":true,"style":{"background":"#FFABD5"}}]}]}]},{"id":"8d1b6d1f-2abc-4271-b261-c54045cf3dd2","topic":"性质：","expanded":true,"children":[{"id":"513b01ce-cad6-4639-9904-4a10fce81918","topic":"无向图：对称矩阵","expanded":true}]}]},{"id":"6f1b0646b3cb3d91b4459ab100","topic":"邻接表（数组+链表）","expanded":true,"children":[{"id":"b7e881f2423a6c9354b198bede","topic":"稀疏图","expanded":true},{"id":"e279584b1eaa0b733279baa11a","topic":"需要大量计算入度最好用【逆邻接表】","expanded":true}]},{"id":"c0e8e09290ebc8d0aed1dada6a","topic":"十字链表（有向）","expanded":true,"children":[{"id":"a039038d-36b3-4e32-8f0f-57f17cfb2f5c","topic":"对邻接表的优化：又想要入度又想要出度","expanded":true,"children":[{"id":"45d9794a2db9a74cc3585a8a69","topic":"顶点结点","expanded":true,"children":[{"id":"4a0b434429a953c4aef6184752","topic":"<data, in, out>","expanded":true}]},{"id":"71fa069cfc29ed11096c0a2f7b","topic":"弧结点","expanded":true,"children":[{"id":"c79bf9afe7b9933e8ad159776b","topic":"<尾, 头, 同头, 同尾>","expanded":true}]}]},{"id":"25985a1d-6d8c-4153-a074-a8161bf93202","topic":"画图三步走：","expanded":true,"children":[{"id":"23bae545-aa70-402a-bb06-e1e60bc2bd5d","topic":"1. 画邻接表","expanded":true,"children":[{"id":"01c85a7b-a327-4b7a-b5e5-9c8364a774f3","topic":"考题注意顶点序号从0还是从1开始","expanded":true}]},{"id":"22514444-e70c-4d7e-bc39-d1e71079d8b7","topic":"2. 增加弧结点的域","expanded":true},{"id":"1c849a56-2d2f-4a9a-b676-dab31c05a198","topic":"3. 自己指向自己","expanded":true}]},{"id":"e8d93c80ffab8587758a697bfc","topic":"如何画图：","expanded":true,"hyperlink":"https://www.bilibili.com/video/BV1hV411t7SC?from=search&seid=4785318972996389561&spm_id_from=333.337.0.0","image":{"src":"https://gastigado.cnies.org/d/BrushUP/mm-a09e86457f10c8.png","width":537,"height":247}}]},{"id":"c4985f3050c8692d1521e8defa","topic":"多重链表（无向）","expanded":true,"children":[{"id":"eac889b8-c984-432e-a8e9-da71feb67b21","topic":"目的：删除边的时候比较麻烦（要搜两个节点），因此我们就把两个节点合二为一","expanded":true},{"id":"017bb802db29de0f66a4493eb8","topic":"先画好点和边，然后找到相同的字母接起来","expanded":true,"image":{"src":"https://gastigado.cnies.org/d/BrushUP/mm-d65beb353a7356.png","width":379,"height":165},"children":[{"id":"9fd85a412fcae498edc028a4d6","topic":"注意：边中存的应该是结点序号，例如a-0，b-1，此处也提个醒","expanded":true}]}]}]},{"id":"c2d8e84ba30998ce437ffaa670","topic":"图的遍历","expanded":true,"children":[{"id":"82299eee52082f9c8f3b38180d","topic":"BFS","expanded":true,"children":[{"id":"48185450f2aa378a7e77baef61","topic":"队列","expanded":true,"style":{"background":"#FDD834"},"children":[{"id":"4b59f579d56b902796c10be8f6","topic":"邻接表 O(v + e)","expanded":true,"style":{"background":"#FDD834"}},{"id":"a7bbd484148bbad6def8e91496","topic":"邻接矩阵 O(v^2)","expanded":true,"style":{"background":"#FDD834"}}]},{"id":"d949835af27885dc68c75a2e2e","topic":"广度优先生成树","expanded":true,"style":{"background":"#8EDDF9"},"children":[{"id":"a25a5b68625a4cc0e07cbbac28","topic":"只针对无权图进行BFS即可得到最小生成树","expanded":true,"style":{"background":"#8EDDF9"},"children":[{"id":"c94bdb8fdd28d4b79e8df8df84","topic":"时间复杂度：O(v^2)/O(v+e)","expanded":true,"style":{"background":"#8EDDF9"}}]}]},{"id":"0d7a99fa-fee8-44ad-9a4a-d9d36b934ddd","topic":"要求掌握代码（队列实现）","expanded":true,"children":[{"id":"94a58368-35ed-4527-b44b-36e4a2f3952e","topic":"BFS_MIN_Distance","expanded":true,"code":{"lang":"cpp","code":"void BFS_MIN_Distance(Graph G, int u) {\n    // d[i] 表示从u到i结点的最短路径\n    for(int i = 0; i < G.vexnum; ++i)\n        d[i] = ∞ ;\n    visited[u] = TRUE;\n    d[u] = 0;\n    EnQueue(Q, u); // Q 是BFS队列，Q.push(u)\n    while(!isEmpty(Q)) {    // 如果还有队列\n        DeQueue(Q, u); // 出队，u = Q.pull()\n        for(w = FirstNeighbor(G,u); w >= 0; w = NextNeighbor(G,u,w))\n            // 遍历取出的队列的元素的邻接顶点\n            if(!visited[w]) { // 如果w为u尚未访问的节点\n                visited[w] = TRUE; // 添加访问标记\n                d[w] = d[u] + 1; // 路径长度 + 1\n                EnQueue(Q,w); // 入队，Q.push(w)\n            }\n    }\n}","title":"BFS_MIN_Distance","tokens":[[{"text":"void","darkColor":"#74CBC4"},{"text":" ","darkColor":"#DEDBD2"},{"text":"BFS_MIN_Distance","darkColor":"#6EC0DF"},{"text":"(","darkColor":"#BAB5A8"},{"text":"Graph","darkColor":"#74CBC4"},{"text":" ","darkColor":"#DEDBD2"},{"text":"G","darkColor":"#D5C5AA"},{"text":",","darkColor":"#BAB5A8"},{"text":" ","darkColor":"#DEDBD2"},{"text":"int","darkColor":"#74CBC4"},{"text":" ","darkColor":"#DEDBD2"},{"text":"u","darkColor":"#D5C5AA"},{"text":")","darkColor":"#BAB5A8"},{"text":" ","darkColor":"#DEDBD2"},{"text":"{","darkColor":"#BAB5A8"}],[{"text":"    // d[i] 表示从u到i结点的最短路径","darkColor":"#908B7E"}],[{"text":"    ","darkColor":"#DEDBD2"},{"text":"for","darkColor":"#8EA4E2"},{"text":"(","darkColor":"#BAB5A8"},{"text":"int","darkColor":"#74CBC4"},{"text":" ","darkColor":"#DEDBD2"},{"text":"i","darkColor":"#EEECE6"},{"text":" ","darkColor":"#DEDBD2"},{"text":"=","darkColor":"#BAB5A8"},{"text":" ","darkColor":"#DEDBD2"},{"text":"0","darkColor":"#E2B159"},{"text":";","darkColor":"#BAB5A8"},{"text":" ","darkColor":"#DEDBD2"},{"text":"i","darkColor":"#EEECE6"},{"text":" ","darkColor":"#DEDBD2"},{"text":"<","darkColor":"#BAB5A8"},{"text":" ","darkColor":"#DEDBD2"},{"text":"G","darkColor":"#EEECE6"},{"text":".","darkColor":"#BAB5A8"},{"text":"vexnum","darkColor":"#D5C5AA"},{"text":";","darkColor":"#BAB5A8"},{"text":" ","darkColor":"#DEDBD2"},{"text":"++","darkColor":"#BAB5A8"},{"text":"i","darkColor":"#EEECE6"},{"text":")","darkColor":"#BAB5A8"}],[{"text":"        ","darkColor":"#DEDBD2"},{"text":"d","darkColor":"#EEECE6"},{"text":"[","darkColor":"#BAB5A8"},{"text":"i","darkColor":"#EEECE6"},{"text":"]","darkColor":"#BAB5A8"},{"text":" ","darkColor":"#DEDBD2"},{"text":"=","darkColor":"#BAB5A8"},{"text":" ∞ ","darkColor":"#DEDBD2"},{"text":";","darkColor":"#BAB5A8"}],[{"text":"    ","darkColor":"#DEDBD2"},{"text":"visited","darkColor":"#EEECE6"},{"text":"[","darkColor":"#BAB5A8"},{"text":"u","darkColor":"#EEECE6"},{"text":"]","darkColor":"#BAB5A8"},{"text":" ","darkColor":"#DEDBD2"},{"text":"=","darkColor":"#BAB5A8"},{"text":" ","darkColor":"#DEDBD2"},{"text":"TRUE","darkColor":"#EEECE6"},{"text":";","darkColor":"#BAB5A8"}],[{"text":"    ","darkColor":"#DEDBD2"},{"text":"d","darkColor":"#EEECE6"},{"text":"[","darkColor":"#BAB5A8"},{"text":"u","darkColor":"#EEECE6"},{"text":"]","darkColor":"#BAB5A8"},{"text":" ","darkColor":"#DEDBD2"},{"text":"=","darkColor":"#BAB5A8"},{"text":" ","darkColor":"#DEDBD2"},{"text":"0","darkColor":"#E2B159"},{"text":";","darkColor":"#BAB5A8"}],[{"text":"    ","darkColor":"#DEDBD2"},{"text":"EnQueue","darkColor":"#6EC0DF"},{"text":"(","darkColor":"#BAB5A8"},{"text":"Q","darkColor":"#EEECE6"},{"text":",","darkColor":"#BAB5A8"},{"text":" ","darkColor":"#DEDBD2"},{"text":"u","darkColor":"#EEECE6"},{"text":");","darkColor":"#BAB5A8"},{"text":" // Q 是BFS队列，Q.push(u)","darkColor":"#908B7E"}],[{"text":"    ","darkColor":"#DEDBD2"},{"text":"while","darkColor":"#8EA4E2"},{"text":"(","darkColor":"#BAB5A8"},{"text":"!","darkColor":"#8EA4E2"},{"text":"isEmpty","darkColor":"#6EC0DF"},{"text":"(","darkColor":"#BAB5A8"},{"text":"Q","darkColor":"#EEECE6"},{"text":"))","darkColor":"#BAB5A8"},{"text":" ","darkColor":"#DEDBD2"},{"text":"{","darkColor":"#BAB5A8"},{"text":"    // 如果还有队列","darkColor":"#908B7E"}],[{"text":"        ","darkColor":"#DEDBD2"},{"text":"DeQueue","darkColor":"#6EC0DF"},{"text":"(","darkColor":"#BAB5A8"},{"text":"Q","darkColor":"#EEECE6"},{"text":",","darkColor":"#BAB5A8"},{"text":" ","darkColor":"#DEDBD2"},{"text":"u","darkColor":"#EEECE6"},{"text":");","darkColor":"#BAB5A8"},{"text":" // 出队，u = Q.pull()","darkColor":"#908B7E"}],[{"text":"        ","darkColor":"#DEDBD2"},{"text":"for","darkColor":"#8EA4E2"},{"text":"(","darkColor":"#BAB5A8"},{"text":"w","darkColor":"#EEECE6"},{"text":" ","darkColor":"#DEDBD2"},{"text":"=","darkColor":"#BAB5A8"},{"text":" ","darkColor":"#DEDBD2"},{"text":"FirstNeighbor","darkColor":"#6EC0DF"},{"text":"(","darkColor":"#BAB5A8"},{"text":"G","darkColor":"#EEECE6"},{"text":",","darkColor":"#BAB5A8"},{"text":"u","darkColor":"#EEECE6"},{"text":");","darkColor":"#BAB5A8"},{"text":" ","darkColor":"#DEDBD2"},{"text":"w","darkColor":"#EEECE6"},{"text":" ","darkColor":"#DEDBD2"},{"text":">=","darkColor":"#BAB5A8"},{"text":" ","darkColor":"#DEDBD2"},{"text":"0","darkColor":"#E2B159"},{"text":";","darkColor":"#BAB5A8"},{"text":" ","darkColor":"#DEDBD2"},{"text":"w","darkColor":"#EEECE6"},{"text":" ","darkColor":"#DEDBD2"},{"text":"=","darkColor":"#BAB5A8"},{"text":" ","darkColor":"#DEDBD2"},{"text":"NextNeighbor","darkColor":"#6EC0DF"},{"text":"(","darkColor":"#BAB5A8"},{"text":"G","darkColor":"#EEECE6"},{"text":",","darkColor":"#BAB5A8"},{"text":"u","darkColor":"#EEECE6"},{"text":",","darkColor":"#BAB5A8"},{"text":"w","darkColor":"#EEECE6"},{"text":"))","darkColor":"#BAB5A8"}],[{"text":"            // 遍历取出的队列的元素的邻接顶点","darkColor":"#908B7E"}],[{"text":"            ","darkColor":"#DEDBD2"},{"text":"if","darkColor":"#8EA4E2"},{"text":"(","darkColor":"#BAB5A8"},{"text":"!","darkColor":"#8EA4E2"},{"text":"visited","darkColor":"#EEECE6"},{"text":"[","darkColor":"#BAB5A8"},{"text":"w","darkColor":"#EEECE6"},{"text":"])","darkColor":"#BAB5A8"},{"text":" ","darkColor":"#DEDBD2"},{"text":"{","darkColor":"#BAB5A8"},{"text":" // 如果w为u尚未访问的节点","darkColor":"#908B7E"}],[{"text":"                ","darkColor":"#DEDBD2"},{"text":"visited","darkColor":"#EEECE6"},{"text":"[","darkColor":"#BAB5A8"},{"text":"w","darkColor":"#EEECE6"},{"text":"]","darkColor":"#BAB5A8"},{"text":" ","darkColor":"#DEDBD2"},{"text":"=","darkColor":"#BAB5A8"},{"text":" ","darkColor":"#DEDBD2"},{"text":"TRUE","darkColor":"#EEECE6"},{"text":";","darkColor":"#BAB5A8"},{"text":" // 添加访问标记","darkColor":"#908B7E"}],[{"text":"                ","darkColor":"#DEDBD2"},{"text":"d","darkColor":"#EEECE6"},{"text":"[","darkColor":"#BAB5A8"},{"text":"w","darkColor":"#EEECE6"},{"text":"]","darkColor":"#BAB5A8"},{"text":" ","darkColor":"#DEDBD2"},{"text":"=","darkColor":"#BAB5A8"},{"text":" ","darkColor":"#DEDBD2"},{"text":"d","darkColor":"#EEECE6"},{"text":"[","darkColor":"#BAB5A8"},{"text":"u","darkColor":"#EEECE6"},{"text":"]","darkColor":"#BAB5A8"},{"text":" ","darkColor":"#DEDBD2"},{"text":"+","darkColor":"#BAB5A8"},{"text":" ","darkColor":"#DEDBD2"},{"text":"1","darkColor":"#E2B159"},{"text":";","darkColor":"#BAB5A8"},{"text":" // 路径长度 + 1","darkColor":"#908B7E"}],[{"text":"                ","darkColor":"#DEDBD2"},{"text":"EnQueue","darkColor":"#6EC0DF"},{"text":"(","darkColor":"#BAB5A8"},{"text":"Q","darkColor":"#EEECE6"},{"text":",","darkColor":"#BAB5A8"},{"text":"w","darkColor":"#EEECE6"},{"text":");","darkColor":"#BAB5A8"},{"text":" // 入队，Q.push(w)","darkColor":"#908B7E"}],[{"text":"            ","darkColor":"#DEDBD2"},{"text":"}","darkColor":"#BAB5A8"}],[{"text":"    ","darkColor":"#DEDBD2"},{"text":"}","darkColor":"#BAB5A8"}],[{"text":"}","darkColor":"#BAB5A8"}]]}}]}]},{"id":"ec29471e7fc9d41598c8394c58","topic":"DFS","expanded":true,"children":[{"id":"af6a6c3be55b9f7c52241acea1","topic":"递归/堆栈","expanded":true,"style":{"background":"#FDD834"},"children":[{"id":"61ea45253f4b9a205bd5085018","topic":"邻接表 O(v + e)","expanded":true,"style":{"background":"#FDD834"}},{"id":"86b955f33838dbfd7c6a2b5a41","topic":"邻接矩阵 O(v^2)","expanded":true,"style":{"background":"#FDD834"}}]},{"id":"093a6ff4bcea6008a7b648bad3","topic":"深度优先生成树","expanded":true,"style":{"background":"#8EDDF9"},"children":[{"id":"0ef991c3521844025fba6ae74d","topic":"只针对无权图进行DFS即可得到最小生成树","expanded":true,"style":{"background":"#8EDDF9"},"children":[{"id":"30ba3bbfded8a79ca99d29640a","topic":"时间复杂度：O(v^2)/O(v+e)","expanded":true,"style":{"background":"#8EDDF9"}}]}]},{"id":"1d61c43f-3437-4026-9b67-a2803fd5a994","topic":"要求掌握代码（递归实现）","expanded":true,"children":[{"id":"8e3a117d-2240-4e44-a00b-e90955000e1c","topic":"DFSTraverse & DFS","expanded":true,"code":{"lang":"cpp","code":"bool visited[MAX_VERTEX_NUM]; //访问标记数组\nvoid DFSTraverse (Graph G) { //对图G进行深度优先遍历\n    for(v = 0; v < G.vexnum; ++v)\n        visited[v] = FALSE;    //初始化已访问标记数组\n\n    for(v = 0; v < G.vexnum; ++v) //本代码中是从v=0开始遍历\n        if(!visited[v])\n            DFS(G,v);\n}\n\nvoid DFS(Graph G, int v) { // 从顶点v出发，深度优先遍历图G\n    visit(v);               // 访问顶点v\n    visited[v] = TRUE;      // 设已访问标记\n    for(w = FirstNeighbor(G,v); w >= 0; w = NextNeighbor(G,v,w))\n        if(!visited[w])     // w为v的尚未访问的邻接顶点\n            DFS(G,w);\n}","title":"DFSTraverse & DFS","tokens":[[{"text":"bool","darkColor":"#74CBC4"},{"text":" ","darkColor":"#DEDBD2"},{"text":"visited","darkColor":"#EEECE6"},{"text":"[","darkColor":"#BAB5A8"},{"text":"MAX_VERTEX_NUM","darkColor":"#EEECE6"},{"text":"];","darkColor":"#BAB5A8"},{"text":" //访问标记数组","darkColor":"#908B7E"}],[{"text":"void","darkColor":"#74CBC4"},{"text":" ","darkColor":"#DEDBD2"},{"text":"DFSTraverse","darkColor":"#6EC0DF"},{"text":" ","darkColor":"#DEDBD2"},{"text":"(","darkColor":"#BAB5A8"},{"text":"Graph","darkColor":"#74CBC4"},{"text":" ","darkColor":"#DEDBD2"},{"text":"G","darkColor":"#D5C5AA"},{"text":")","darkColor":"#BAB5A8"},{"text":" ","darkColor":"#DEDBD2"},{"text":"{","darkColor":"#BAB5A8"},{"text":" //对图G进行深度优先遍历","darkColor":"#908B7E"}],[{"text":"    ","darkColor":"#DEDBD2"},{"text":"for","darkColor":"#8EA4E2"},{"text":"(","darkColor":"#BAB5A8"},{"text":"v","darkColor":"#EEECE6"},{"text":" ","darkColor":"#DEDBD2"},{"text":"=","darkColor":"#BAB5A8"},{"text":" ","darkColor":"#DEDBD2"},{"text":"0","darkColor":"#E2B159"},{"text":";","darkColor":"#BAB5A8"},{"text":" ","darkColor":"#DEDBD2"},{"text":"v","darkColor":"#EEECE6"},{"text":" ","darkColor":"#DEDBD2"},{"text":"<","darkColor":"#BAB5A8"},{"text":" ","darkColor":"#DEDBD2"},{"text":"G","darkColor":"#EEECE6"},{"text":".","darkColor":"#BAB5A8"},{"text":"vexnum","darkColor":"#D5C5AA"},{"text":";","darkColor":"#BAB5A8"},{"text":" ","darkColor":"#DEDBD2"},{"text":"++","darkColor":"#BAB5A8"},{"text":"v","darkColor":"#EEECE6"},{"text":")","darkColor":"#BAB5A8"}],[{"text":"        ","darkColor":"#DEDBD2"},{"text":"visited","darkColor":"#EEECE6"},{"text":"[","darkColor":"#BAB5A8"},{"text":"v","darkColor":"#EEECE6"},{"text":"]","darkColor":"#BAB5A8"},{"text":" ","darkColor":"#DEDBD2"},{"text":"=","darkColor":"#BAB5A8"},{"text":" ","darkColor":"#DEDBD2"},{"text":"FALSE","darkColor":"#EEECE6"},{"text":";","darkColor":"#BAB5A8"},{"text":"    //初始化已访问标记数组","darkColor":"#908B7E"}],[{"text":" "}],[{"text":"    ","darkColor":"#DEDBD2"},{"text":"for","darkColor":"#8EA4E2"},{"text":"(","darkColor":"#BAB5A8"},{"text":"v","darkColor":"#EEECE6"},{"text":" ","darkColor":"#DEDBD2"},{"text":"=","darkColor":"#BAB5A8"},{"text":" ","darkColor":"#DEDBD2"},{"text":"0","darkColor":"#E2B159"},{"text":";","darkColor":"#BAB5A8"},{"text":" ","darkColor":"#DEDBD2"},{"text":"v","darkColor":"#EEECE6"},{"text":" ","darkColor":"#DEDBD2"},{"text":"<","darkColor":"#BAB5A8"},{"text":" ","darkColor":"#DEDBD2"},{"text":"G","darkColor":"#EEECE6"},{"text":".","darkColor":"#BAB5A8"},{"text":"vexnum","darkColor":"#D5C5AA"},{"text":";","darkColor":"#BAB5A8"},{"text":" ","darkColor":"#DEDBD2"},{"text":"++","darkColor":"#BAB5A8"},{"text":"v","darkColor":"#EEECE6"},{"text":")","darkColor":"#BAB5A8"},{"text":" //本代码中是从v=0开始遍历","darkColor":"#908B7E"}],[{"text":"        ","darkColor":"#DEDBD2"},{"text":"if","darkColor":"#8EA4E2"},{"text":"(","darkColor":"#BAB5A8"},{"text":"!","darkColor":"#8EA4E2"},{"text":"visited","darkColor":"#EEECE6"},{"text":"[","darkColor":"#BAB5A8"},{"text":"v","darkColor":"#EEECE6"},{"text":"])","darkColor":"#BAB5A8"}],[{"text":"            ","darkColor":"#DEDBD2"},{"text":"DFS","darkColor":"#6EC0DF"},{"text":"(","darkColor":"#BAB5A8"},{"text":"G","darkColor":"#EEECE6"},{"text":",","darkColor":"#BAB5A8"},{"text":"v","darkColor":"#EEECE6"},{"text":");","darkColor":"#BAB5A8"}],[{"text":"}","darkColor":"#BAB5A8"}],[{"text":" "}],[{"text":"void","darkColor":"#74CBC4"},{"text":" ","darkColor":"#DEDBD2"},{"text":"DFS","darkColor":"#6EC0DF"},{"text":"(","darkColor":"#BAB5A8"},{"text":"Graph","darkColor":"#74CBC4"},{"text":" ","darkColor":"#DEDBD2"},{"text":"G","darkColor":"#D5C5AA"},{"text":",","darkColor":"#BAB5A8"},{"text":" ","darkColor":"#DEDBD2"},{"text":"int","darkColor":"#74CBC4"},{"text":" ","darkColor":"#DEDBD2"},{"text":"v","darkColor":"#D5C5AA"},{"text":")","darkColor":"#BAB5A8"},{"text":" ","darkColor":"#DEDBD2"},{"text":"{","darkColor":"#BAB5A8"},{"text":" // 从顶点v出发，深度优先遍历图G","darkColor":"#908B7E"}],[{"text":"    ","darkColor":"#DEDBD2"},{"text":"visit","darkColor":"#6EC0DF"},{"text":"(","darkColor":"#BAB5A8"},{"text":"v","darkColor":"#EEECE6"},{"text":");","darkColor":"#BAB5A8"},{"text":"               // 访问顶点v","darkColor":"#908B7E"}],[{"text":"    ","darkColor":"#DEDBD2"},{"text":"visited","darkColor":"#EEECE6"},{"text":"[","darkColor":"#BAB5A8"},{"text":"v","darkColor":"#EEECE6"},{"text":"]","darkColor":"#BAB5A8"},{"text":" ","darkColor":"#DEDBD2"},{"text":"=","darkColor":"#BAB5A8"},{"text":" ","darkColor":"#DEDBD2"},{"text":"TRUE","darkColor":"#EEECE6"},{"text":";","darkColor":"#BAB5A8"},{"text":"      // 设已访问标记","darkColor":"#908B7E"}],[{"text":"    ","darkColor":"#DEDBD2"},{"text":"for","darkColor":"#8EA4E2"},{"text":"(","darkColor":"#BAB5A8"},{"text":"w","darkColor":"#EEECE6"},{"text":" ","darkColor":"#DEDBD2"},{"text":"=","darkColor":"#BAB5A8"},{"text":" ","darkColor":"#DEDBD2"},{"text":"FirstNeighbor","darkColor":"#6EC0DF"},{"text":"(","darkColor":"#BAB5A8"},{"text":"G","darkColor":"#EEECE6"},{"text":",","darkColor":"#BAB5A8"},{"text":"v","darkColor":"#EEECE6"},{"text":");","darkColor":"#BAB5A8"},{"text":" ","darkColor":"#DEDBD2"},{"text":"w","darkColor":"#EEECE6"},{"text":" ","darkColor":"#DEDBD2"},{"text":">=","darkColor":"#BAB5A8"},{"text":" ","darkColor":"#DEDBD2"},{"text":"0","darkColor":"#E2B159"},{"text":";","darkColor":"#BAB5A8"},{"text":" ","darkColor":"#DEDBD2"},{"text":"w","darkColor":"#EEECE6"},{"text":" ","darkColor":"#DEDBD2"},{"text":"=","darkColor":"#BAB5A8"},{"text":" ","darkColor":"#DEDBD2"},{"text":"NextNeighbor","darkColor":"#6EC0DF"},{"text":"(","darkColor":"#BAB5A8"},{"text":"G","darkColor":"#EEECE6"},{"text":",","darkColor":"#BAB5A8"},{"text":"v","darkColor":"#EEECE6"},{"text":",","darkColor":"#BAB5A8"},{"text":"w","darkColor":"#EEECE6"},{"text":"))","darkColor":"#BAB5A8"}],[{"text":"        ","darkColor":"#DEDBD2"},{"text":"if","darkColor":"#8EA4E2"},{"text":"(","darkColor":"#BAB5A8"},{"text":"!","darkColor":"#8EA4E2"},{"text":"visited","darkColor":"#EEECE6"},{"text":"[","darkColor":"#BAB5A8"},{"text":"w","darkColor":"#EEECE6"},{"text":"])","darkColor":"#BAB5A8"},{"text":"     // w为v的尚未访问的邻接顶点","darkColor":"#908B7E"}],[{"text":"            ","darkColor":"#DEDBD2"},{"text":"DFS","darkColor":"#6EC0DF"},{"text":"(","darkColor":"#BAB5A8"},{"text":"G","darkColor":"#EEECE6"},{"text":",","darkColor":"#BAB5A8"},{"text":"w","darkColor":"#EEECE6"},{"text":");","darkColor":"#BAB5A8"}],[{"text":"}","darkColor":"#BAB5A8"}]]}}]}]},{"id":"d7bad478-e624-49fd-920e-ee4a725d4d46","topic":"考频：低","expanded":true,"style":{"background":"#8EDDF9"},"children":[{"id":"0377e9b1-e51f-4e47-9f50-0e55ed9f5c39","topic":"13、15、16","expanded":true}]}]},{"id":"f3a8fd288c7aad972e73cac8a5","topic":"图的应用","expanded":true,"style":{"background":"#8EDE99"},"children":[{"id":"ac9504d5-a9ef-4cdb-98cd-e93a825f930f","topic":"考频：超高","expanded":true,"style":{"background":"#9C27B0"},"children":[{"id":"59021343-6883-4134-ad36-6637e1d21fbb","topic":"10、12*3、13、14、16*2、18、19*2、20*3、21*2、22、09大、11大、14大、17大、18大","expanded":true,"children":[{"id":"7bc8ee32-45e3-4e12-ae71-6902cdeac91d","topic":"大题都是应用题","expanded":true}]}]},{"id":"26bbcd8a78cb259eb09f591e38","topic":"最小生成树算法","expanded":true,"style":{"background":"#8EDE99"},"children":[{"id":"79c92dc98809703d72895899bd","topic":"无权图：","expanded":true,"children":[{"id":"374abae07b794d5a749d5aebc9","topic":"BFS/DFS都可以找最小生成树","expanded":true,"style":{"background":"#8EDDF9"}}]},{"id":"60ebe0f3e848086049965ae052","topic":"有权图","expanded":true,"children":[{"id":"e8a884a1c16b9eac52bc6b72d3","topic":"Prim算法","expanded":true,"style":{"background":"#8EDDF9"},"children":[{"id":"a4582fc8b0b91ad7746ba8cc96","topic":"从头到尾只有一个集合，不断扩大","expanded":true,"style":{"background":"#8EDDF9"},"image":{"src":"https://gastigado.cnies.org/d/BrushUP/mm-960d694de11935.png","width":337,"height":223},"children":[{"id":"825bb38b21ab8d94e71c596fe6","topic":"时间复杂度","expanded":true,"style":{"background":"#8EDDF9"},"formula":{"tex":"O(V^2)","displayMode":true,"mathml":"<span class=\"katex\"><math xmlns=\"http://www.w3.org/1998/Math/MathML\" display=\"block\"><semantics><mrow><mi>O</mi><mo stretchy=\"false\">(</mo><msup><mi>V</mi><mn>2</mn></msup><mo stretchy=\"false\">)</mo></mrow><annotation encoding=\"application/x-tex\">O(V^2)</annotation></semantics></math></span>"}},{"id":"037af337-6cef-441e-974c-f4782fa5cec4","topic":"掌握伪代码：英文代码+每一句话都写注释","expanded":true,"code":{"lang":"plaintext","code":"/**\n* G: 图；T: 生成树，树空；\n*/\nvoid Prim(G, T) {\n    T.V = {w}; // 添加任意一个G的顶点w到T的顶点集V中\n    while((G.V - T.V) != ø) { // 如果此时树中不包含全部的顶点\n        (u,v) = find_min_weight(G);\n        // 定义find_min_weight()作用是找到\n        // 满足是 u ∈ T.V 且 v ∈ (G.V - T.V)，且权值最小的边(u,v)\n        T.E = T.E ∪ {(u,v)}; // 边添加到树的边集E中\n        T.V = T.V ∪ {v}; // 顶点插入到树的顶点集V中\n    }\n}","title":"Prim(G, T)","tokens":[[{"text":"/**"}],[{"text":"* G: 图；T: 生成树，树空；"}],[{"text":"*/"}],[{"text":"void Prim(G, T) {"}],[{"text":"    T.V = {w}; // 添加任意一个G的顶点w到T的顶点集V中"}],[{"text":"    while((G.V - T.V) != ø) { // 如果此时树中不包含全部的顶点"}],[{"text":"        (u,v) = find_min_weight(G);"}],[{"text":"        // 定义find_min_weight()作用是找到"}],[{"text":"        // 满足是 u ∈ T.V 且 v ∈ (G.V - T.V)，且权值最小的边(u,v)"}],[{"text":"        T.E = T.E ∪ {(u,v)}; // 边添加到树的边集E中"}],[{"text":"        T.V = T.V ∪ {v}; // 顶点插入到树的顶点集V中"}],[{"text":"    }"}],[{"text":"}"}]]}}]},{"id":"847defec-6bb4-4d33-ba94-9c162240f986","topic":"Party","expanded":true,"icons":["emoji:💬"],"style":{"borderStyle":"dashed","borderColor":"#F59E0B"}}]},{"id":"cc7a983cf60b3e5fde363ae5cf","topic":"Kruskal算法","expanded":true,"style":{"background":"#8EDDF9"},"children":[{"id":"c5e91ae3bc9ae6dd57d2aadd91","topic":"每次直接找图中最小边，如果不成环，就加进去","expanded":true,"style":{"background":"#8EDDF9"},"image":{"src":"https://gastigado.cnies.org/d/BrushUP/mm-2d48c17e5a5353.png","width":320,"height":218},"children":[{"id":"eddb80c83018daf5a4be49c49c","topic":"时间复杂度","expanded":true,"style":{"background":"#8EDDF9"},"formula":{"tex":"O(e\\log_2 e)","displayMode":true,"mathml":"<span class=\"katex\"><math xmlns=\"http://www.w3.org/1998/Math/MathML\" display=\"block\"><semantics><mrow><mi>O</mi><mo stretchy=\"false\">(</mo><mi>e</mi><msub><mrow><mi>log</mi><mo>⁡</mo></mrow><mn>2</mn></msub><mi>e</mi><mo stretchy=\"false\">)</mo></mrow><annotation encoding=\"application/x-tex\">O(e\\log_2 e)</annotation></semantics></math></span>"}},{"id":"b6d6194f-0237-48bd-9ad0-82d407f4ec85","topic":"掌握伪代码：英文代码+每一句话都写注释","expanded":true,"code":{"lang":"plaintext","code":"/**\n* V: 图的顶点集；T: 生成树；\n*/\nvoid Kruskal(V, T) {\n    T.V = V; // 生成树中顶点就是图的顶点集\n    while(compute_connect(T) > 1) {\n        // 定义compute_connect()作用是找树的连通分量个数\n        // 如果连通分量数 > 1\n        (u, v) = find_min_weight(T);\n        // 定义find_min_weight()作用是找到\n        // 满足是 u, v 顶点在不同连通分量中，且权值最小的边(u,v)\n        T.E = T.E ∪ {(v, u)}; // 插入边集到T的边集中\n    }\n}","title":"Kruskal(V, T)","tokens":[[{"text":"/**"}],[{"text":"* V: 图的顶点集；T: 生成树；"}],[{"text":"*/"}],[{"text":"void Kruskal(V, T) {"}],[{"text":"    T.V = V; // 生成树中顶点就是图的顶点集"}],[{"text":"    while(compute_connect(T) > 1) {"}],[{"text":"        // 定义compute_connect()作用是找树的连通分量个数"}],[{"text":"        // 如果连通分量数 > 1"}],[{"text":"        (u, v) = find_min_weight(T);"}],[{"text":"        // 定义find_min_weight()作用是找到"}],[{"text":"        // 满足是 u, v 顶点在不同连通分量中，且权值最小的边(u,v)"}],[{"text":"        T.E = T.E ∪ {(v, u)}; // 插入边集到T的边集中"}],[{"text":"    }"}],[{"text":"}"}]]}}]}]}]}]},{"id":"54eafd86919b91806cd1da0747","topic":"最短路径算法","expanded":true,"style":{"background":"#8EDE99"},"children":[{"id":"1749680398ab62772d2d18845c","topic":"无权图：","expanded":true,"children":[{"id":"8f6b5882ee8a34b2398b8b42ea","topic":"BFS可以找最短路径","expanded":true,"style":{"background":"#8EDDF9"}}]},{"id":"994abddea329dcdf4715195035","topic":"有权图","expanded":true,"children":[{"id":"91c985d990fb2affa41e6b0694","topic":"Dijkstra算法","expanded":true,"style":{"background":"#8EDDF9"},"children":[{"id":"2618d50aabd9d0b12733984ec2","topic":"使用final[], path[], dis[]去搜寻最短路径，每次都在dis[]中找到最短的路径。","expanded":true,"style":{"background":"#8EDDF9"},"image":{"src":"https://gastigado.cnies.org/d/BrushUP/mm-30edd9940f95a0.png","width":363,"height":326},"children":[{"id":"3edb1b29432a1f17d3fd293425","topic":"基于贪心算法","expanded":true,"style":{"background":"#FDD834"}},{"id":"e5eb54e67ef91e23f7c0388090","topic":"可以判断有环图","expanded":true},{"id":"d06a5ab922ebbec845bc698b75","topic":"无法判断带负权值的图 ：算法失效","expanded":true,"style":{"background":"#8EDE99"}},{"id":"b709acd30f8aa46b50c45934fc","topic":"时间复杂度 O(v^2)","expanded":true,"style":{"background":"#8EDDF9"},"children":[{"id":"536b7e6c3c2822d0dda448a257","topic":"找两个点的时间复杂度，所有点仍是O(v^3)","expanded":true}]}]}]},{"id":"d7e9462a2b4a4f93247489a7ab","topic":"Floyd算法","expanded":true,"style":{"background":"#8EDDF9"},"children":[{"id":"f3f9adfb19fa8356596bf881df","topic":"动态规范算法，动态维护一个dis[][]和path[][]，每次更新时都加入一个新的节点作为可使用的中转点。","expanded":true,"style":{"background":"#8EDDF9"},"image":{"src":"https://gastigado.cnies.org/d/BrushUP/mm-ed63fe03582232.png","width":406,"height":386},"children":[{"id":"1cdb8694c22a0140b4ff3b4110","topic":"path[]矩阵的用处","expanded":true,"style":{"background":"#FFABD5"},"children":[{"id":"00897f8da55b61199a35c81454","topic":"图示","expanded":true,"style":{"background":"#FFABD5"},"image":{"src":"https://gastigado.cnies.org/d/BrushUP/mm-2f8e0139c5ce7a.png","width":516,"height":266},"children":[{"id":"8a9a805b6e0b7d58817e5a70da","topic":"例如：找V0 到 V4","expanded":true,"children":[{"id":"f12aa798f30a788d77cfe87ec3","topic":"V0 -> V3 -> V4","expanded":true,"style":{"background":"#FDD834"}},{"id":"e3595323e33a43fefcfcc9d48c","topic":"找 V0 到 V3","expanded":true,"style":{"background":"#8EDE99"},"children":[{"id":"9e795f0e114afb7b6925ebf674","topic":"V0 -> V2 -> V3","expanded":true,"style":{"background":"#FDD834"}},{"id":"0d28870ea25ab77fcacaaa8d03","topic":"找 V0 到 V2","expanded":true,"style":{"background":"#8EDE99"},"children":[{"id":"41781049cb6829ff2ccd8b43d9","topic":"直达","expanded":true}]},{"id":"2f593571699bec8423bc691c5d","topic":"找 V2 到 V3","expanded":true,"style":{"background":"#8EDE99"},"children":[{"id":"da1a5a5450d85986ec538b14e2","topic":"V2 -> V1 -> V3","expanded":true,"style":{"background":"#FDD834"}},{"id":"fa4a50704549c42be8d4789c7c","topic":"找V2->V1","expanded":true,"style":{"background":"#8EDE99"},"children":[{"id":"a9d8147394ea83f81cec0ae0bb","topic":"直达","expanded":true}]},{"id":"c5bb8bced00b686510a7cad829","topic":"找V1->V3","expanded":true,"style":{"background":"#8EDE99"},"children":[{"id":"6a6a427e0cb93b51ddc6b9d24d","topic":"直达","expanded":true}]}]}]},{"id":"9539425cf719895a543199dd69","topic":"找 V3 到 V4","expanded":true,"style":{"background":"#8EDE99"},"children":[{"id":"3fab23d6cf299c334dcd4befcd","topic":"直达","expanded":true}]}]}]}]},{"id":"200a2cb7631a52b505a7ea3cbb","topic":"无法判断带负权值的【有环图】","expanded":true,"style":{"background":"#8EDE99"},"children":[{"id":"99d6f315-1839-467f-9162-3782814b0e4e","topic":"环中有负值","expanded":true}]},{"id":"a5188050083aecff08326872a1","topic":"时间复杂度全部顶点","expanded":true,"style":{"background":"#8EDDF9"},"formula":{"tex":"O(V^3)","displayMode":true,"mathml":"<span class=\"katex\"><math xmlns=\"http://www.w3.org/1998/Math/MathML\" display=\"block\"><semantics><mrow><mi>O</mi><mo stretchy=\"false\">(</mo><msup><mi>V</mi><mn>3</mn></msup><mo stretchy=\"false\">)</mo></mrow><annotation encoding=\"application/x-tex\">O(V^3)</annotation></semantics></math></span>"}}]}]}]}]},{"id":"64bb046435bbd37d84802b36e2","topic":"有向无环图\n（DAG)","expanded":true,"style":{"background":"#8EDE99"},"children":[{"id":"8daad02687a96951d3d9d98f4a","topic":"把算式二叉树简化为有向无环图的形式","expanded":true},{"id":"9eb6432e-c79a-4454-965c-b87687c9e2aa","topic":"图示","expanded":true,"image":{"src":"https://gastigado.cnies.org/d/BrushUP/mm-36b4ab599725a3.png","width":450,"height":634}}]},{"id":"60eb1995c69898611525f9dad9","topic":"拓扑排序","expanded":true,"style":{"background":"#8EDE99"},"children":[{"id":"f70b9ac3105a9656e4d05be71b","topic":"AOV网","expanded":true,"style":{"background":"#8EDDF9"},"children":[{"id":"852b01daa4ab9ac22963b9469e","topic":"算法思路","expanded":true,"children":[{"id":"9a692d447ed98c2242325b8400","topic":"找入度为0的点，打印出来，删掉所有与这个点有关的边，一直到最后无点可删","expanded":true,"style":{"background":"#8EDDF9"},"children":[{"id":"a10bd5ac100b210d959e0a9c1a","topic":"时间复杂度：O(v + e)","expanded":true,"style":{"background":"#8EDDF9"}},{"id":"bdf8cf5aab587c67ce567a0a6a","topic":"如果无点可删时，图中仍剩有点，就说明有环","expanded":true}]}]}]},{"id":"cdd8f0a62a8860f60a123b3da2","topic":"逆拓扑排序","expanded":true,"children":[{"id":"97d9ebafeeeb00f1716d9ac464","topic":"同理，可以使用逆向DFS来实现","expanded":true,"children":[{"id":"b4097301f55abb40bada49d612","topic":"https://blog.csdn.net/xza13155/article/details/113923901","expanded":true},{"id":"741a53b2edf900fed494d98c87","topic":"设置一个visited数组，一个nowvisited数组","expanded":true}]}]}]},{"id":"30ca254b30f952d573dddb9bf9","topic":"关键路径","expanded":true,"style":{"background":"#8EDE99"},"children":[{"id":"36b9bc2a38da699040349a2cf2","topic":"AOE网","expanded":true,"style":{"background":"#8EDDF9"},"children":[{"id":"a6ab79dfd0097e60557d9aa783","topic":"节点：事件，边：活动","expanded":true},{"id":"430bc9a780593347fa4e4a41b7","topic":"计算五个量：ve(k), vl(k), e(k), l(k), d(k)","expanded":true,"style":{"background":"#8EDDF9"},"children":[{"id":"d49a63d5bc7aef3b42d9da1b46","topic":"ve(k)：事件的最早发生时间","expanded":true},{"id":"4b28ef28773a9187b016596a45","topic":"vl(k)：事件的不得不发生的时间","expanded":true},{"id":"f38ac81f3998d6dafce669063e","topic":"e(k)：活动的最早发生时间，与箭头尾部ve(k)相同","expanded":true},{"id":"59d9418a614bc9eafc6d2ab191","topic":"l(k)：活动的最晚发生时间，与箭头头部l(k) - weight相同","expanded":true},{"id":"080bdedd76e8a5f309ccc9b056","topic":"d(k) = l(k) - e(k)，如果是0，就说明是关键路径","expanded":true}]},{"id":"8c6b2e8471f82899db75ebe181","topic":"举例","expanded":true,"children":[{"id":"3b5ad5a31ed842cbe9638b1758","topic":"找关键路径ve(i), le(i)","expanded":true,"children":[{"id":"215922387f19f16d3c97a9d5f0","topic":"图示","expanded":true,"image":{"src":"https://gastigado.cnies.org/d/BrushUP/mm-03b81c71a557fd.png","width":233,"height":298}}]},{"id":"c04b9f4c697b968725afba2040","topic":"找关键路径的活动的\ne(i), l(i), l(i)-e(i)","expanded":true,"children":[{"id":"bb5d2539-7dea-4c84-b67b-962ecd27b5c6","topic":"图示","expanded":true,"image":{"src":"https://gastigado.cnies.org/d/BrushUP/mm-4fd4901ee9e022.jpg","width":237,"height":237}}]}]}]}]}]},{"id":"9527430c-6920-4d52-b2a6-2a44fc758d5a","topic":"并查集的应用","expanded":true,"children":[{"id":"e32243d8-b812-4962-980e-0dabdbb91fed","topic":"图的连通分量","expanded":true,"children":[{"id":"e2e83c78-6c1f-46c3-95a7-bc3e90efdafe","topic":"图示","expanded":true,"image":{"src":"https://gastigado.cnies.org/d/BrushUP/mm-9f46cc43ba8de2.png","width":632,"height":383}}]},{"id":"083b953b-a4c0-489c-a6fd-509132b8393f","topic":"判断是否有环","expanded":true,"children":[{"id":"bea65302-a8a5-4d02-857c-4a326aae43a2","topic":"图示","expanded":true,"image":{"src":"https://gastigado.cnies.org/d/BrushUP/mm-ba2d1fae09d732.png","width":635,"height":385}}]},{"id":"c0c912c8-48f7-4512-bb18-eadab8c7aaf2","topic":"Kruskal算法","expanded":true,"children":[{"id":"99bb84ce-322e-4aff-9a46-cc89b1ade729","topic":"Kruskal算法的实现一定需要并查集来判断新的最短路径会不会成环","expanded":true,"children":[{"id":"e224a1ba-4043-49da-9e11-e2fc2a6c4af8","topic":"算法实现","expanded":true,"children":[{"id":"d77a68db-d325-46b7-9530-7517ca40c00e","topic":"把所有的边按权值大小递增排序","expanded":true,"icons":["priority:1"]},{"id":"9b263a62-1b41-41d7-a535-5ac96d34710d","topic":"从小到大，使用Find操作检查是否在同一个集合","expanded":true,"icons":["priority:2"]},{"id":"38ca2eca-44db-4341-940b-e22c0aa5f3ee","topic":"如果不再同一个集合，就用Union把两个集合加入到同一个集合中","expanded":true,"icons":["priority:3"]}]},{"id":"fc169ca7-2c3f-4921-88c3-6b115c050278","topic":"所以时间复杂度为：","expanded":true,"children":[{"id":"3240ac42-cce3-4340-a530-b49db8480e59","topic":"","expanded":true,"children":[{"id":"6d83b34c-cedd-4023-b412-869d3995bc6a","topic":"原因：一共有e条边，执行e轮，并查集Find的时间复杂度为log_2e","expanded":true}],"formula":{"tex":"O(e\\log_2 e)","displayMode":true,"mathml":"<span class=\"katex\"><math xmlns=\"http://www.w3.org/1998/Math/MathML\" display=\"block\"><semantics><mrow><mi>O</mi><mo stretchy=\"false\">(</mo><mi>e</mi><msub><mrow><mi>log</mi><mo>⁡</mo></mrow><mn>2</mn></msub><mi>e</mi><mo stretchy=\"false\">)</mo></mrow><annotation encoding=\"application/x-tex\">O(e\\log_2 e)</annotation></semantics></math></span>"}}]}]}]},{"id":"cca23567-90dc-470c-833f-74cf014002c2","topic":"考频：低","expanded":true,"style":{"background":"#8EDDF9"},"children":[{"id":"292efe8d-35c1-49c9-b854-6369482c0876","topic":"无","expanded":true}]}]},{"id":"ca19ef0113188e8ac532a8dfed","topic":"END","expanded":true}]},"summaries":[{"id":"129c07f3-48ee-4a0a-a540-3b4b04763950","parentId":"fabb26c469f883d3173ef929ad","start":0,"end":0,"label":"不满足：多重图/复杂图"},{"id":"bb4b65f419693ac19c97b85ae7","parentId":"1d7b5dc229fb266116ce49b99a","start":6,"end":7,"label":"生成子图 + 极小连通子图 = 生成树"},{"id":"667a6ab9c37b2e5ae5f9884e1d","parentId":"f7dac218272871cba1d63a83ca","start":1,"end":4,"label":""}],"boundaries":[{"id":"4998e125b1c8c7edb7840a9891","parentId":"1d7b5dc229fb266116ce49b99a","start":2,"end":2,"label":"数据结构只研究这一种"},{"id":"604afdf6f069dda6e8f5484928","parentId":"d949835af27885dc68c75a2e2e","start":0,"end":0,"label":"如果给定的是邻接矩阵，则生成树唯一，如果是邻接表，则生成树不唯一"},{"id":"962b2209531b83e8dec57a1e8f","parentId":"093a6ff4bcea6008a7b648bad3","start":0,"end":0,"label":"如果给定的是邻接矩阵，则生成树唯一，如果是邻接表，则生成树不唯一"},{"id":"315945e71809ea93bb562a0995","parentId":"00897f8da55b61199a35c81454","start":0,"end":0,"label":"多层递归，还是比较麻烦"}]}