邻接表深度优先遍历时间复杂度
时间: 2023-10-17 09:05:46 浏览: 212
邻接表的深度优先遍历时间复杂度为O(ne),其中n表示顶点的个数,e表示边的个数。引用中提到,深度优先遍历是从起始点开始,沿着未被访问的邻接点进行遍历,直到图中所有与起始点连通的顶点都被访问到。因此,邻接表的深度优先遍历需要遍历每个顶点和它的邻接点,所以时间复杂度为O(ne)。<span class="em">1</span><span class="em">2</span><span class="em">3</span>
#### 引用[.reference_title]
- *1* *3* [无向图-邻接链表的深度优先遍历-DFS](https://blog.csdn.net/qiki_tangmingwei/article/details/79340884)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v93^chatsearchT3_2"}}] [.reference_item style="max-width: 50%"]
- *2* [Java弱引用实现源码-DataStructure::kiss_mark::kiss_mark:数据结构、算法总结、学习算法的时间复杂度、...](https://download.csdn.net/download/weixin_38677936/19387889)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v93^chatsearchT3_2"}}] [.reference_item style="max-width: 50%"]
[ .reference_list ]
阅读全文