Figures revision and bug fixes (#1041)

* Revised the figures thoughout the book.

* Utilize roboto and roboto mono as the font faimly of the English edition

* Fix the naming style

* Update two figures.

* Fix margin of the hero image

* Fix margin of the hero image
This commit is contained in:
Yudong Jin
2024-01-12 14:15:07 +08:00
committed by GitHub
parent 0b7e99dafa
commit d85a3bb74d
108 changed files with 25 additions and 25 deletions

Binary file not shown.

Before

Width:  |  Height:  |  Size: 24 KiB

After

Width:  |  Height:  |  Size: 23 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 36 KiB

After

Width:  |  Height:  |  Size: 30 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 22 KiB

After

Width:  |  Height:  |  Size: 20 KiB

View File

@@ -27,7 +27,7 @@
## 贪心算法的优点与局限性
**贪心算法不仅操作直接、实现简单,而且通常效率也很高**。在以上代码中,记硬币最小面值为 $\min(coins)$ ,则贪心选择最多循环 $amt / \min(coins)$ 次,时间复杂度为 $O(amt / \min(coins))$ 。这比动态规划解法的时间复杂度 $O(n \times amt)$ 降低了一个数量级。
**贪心算法不仅操作直接、实现简单,而且通常效率也很高**。在以上代码中,记硬币最小面值为 $\min(coins)$ ,则贪心选择最多循环 $amt / \min(coins)$ 次,时间复杂度为 $O(amt / \min(coins))$ 。这比动态规划解法的时间复杂度 $O(n \times amt)$ 了一个数量级。
然而,**对于某些硬币面值组合,贪心算法并不能找到最优解**。下图给出了两个示例。

Binary file not shown.

Before

Width:  |  Height:  |  Size: 15 KiB

After

Width:  |  Height:  |  Size: 15 KiB