# Algorithms-1 **Repository Path**: WjbStudyLife/Algorithms-1 ## Basic Information - **Project Name**: Algorithms-1 - **Description**: 算法4 所有练习题的 Java 实现 - **Primary Language**: Unknown - **License**: Not specified - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2019-12-21 - **Last Updated**: 2020-12-19 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # Algorithms4 🔥 **算法4** 练习题的 `Java` 实现,持续更新中... 🔥 **算法4** 提供的内置库下载 [algs4.jar](https://algs4.cs.princeton.edu/code/algs4.jar) 🔥 **算法4** 测试数据下载 [algs4-data.zip](https://algs4.cs.princeton.edu/code/algs4-data.zip) 交流本书内容或者习题,请加微信 `bigrice7385` > 下面列出的链接的解答仅用于需要用图像或文档描述的习题, > 其他解答统一整合在各章节各小节目录下 * **4.1 无向图** * [`4.1.1 a`](https://github.com/YangXiaoHei/Algorithms/blob/master/Ch_4_1_Undirected_Graphs/images/Practise_4_1_01.1.png) | [`4.1.1 b`](https://github.com/YangXiaoHei/Algorithms/blob/master/Ch_4_1_Undirected_Graphs/images/Practise_4_1_01.2.png) * [`4.1.2`](https://github.com/YangXiaoHei/Algorithms/blob/master/Ch_4_1_Undirected_Graphs/images/Practise_4_1_02.png) * [`4.1.9`](https://github.com/YangXiaoHei/Algorithms/blob/master/Ch_4_1_Undirected_Graphs/images/Practise_4_1_09.png) * [`4.1.11`](https://github.com/YangXiaoHei/Algorithms/blob/master/Ch_4_1_Undirected_Graphs/images/Practise_4_1_11.png) * [`4.1.14.a`](https://github.com/YangXiaoHei/Algorithms/blob/master/Ch_4_1_Undirected_Graphs/images/Practise_4_1_14.1.png) | [`4.1.14.b`](https://github.com/YangXiaoHei/Algorithms/blob/master/Ch_4_1_Undirected_Graphs/images/Practise_4_1_14.2.png) 对比两图可以发现,用栈来实现的广搜无法达到预期目的,因为栈总是 “贪心”,在还没有处理完本轮加入的所有邻居前就又向自己内部加入新节点。由于栈先进后出的性质,加入新节点后,只能从离起点更远的地方再向前迈向征程,整个过程好比喝醉酒兜圈子,但毕竟地球是圆的,尽管摇摇晃晃,南辕北辙,但最终又能回到起点。 * [`4.1.18`](https://github.com/YangXiaoHei/Algorithms/blob/master/Ch_4_1_Undirected_Graphs/images/Practise_4_1_18.png) * [`4.1.19`](https://github.com/YangXiaoHei/Algorithms/blob/master/Ch_4_1_Undirected_Graphs/images/Practise_4_1_19.png) * [`4.1.20`](https://github.com/YangXiaoHei/Algorithms/blob/master/Ch_4_1_Undirected_Graphs/images/Practise_4_1_20.png)