mirror of
https://github.com/krahets/hello-algo.git
synced 2026-04-13 18:00:18 +08:00
Bug fixes and improvements (#1348)
* Add "reference" for EN version. Bug fixes. * Unify the figure reference as "the figure below" and "the figure above". Bug fixes. * Format the EN markdown files. * Replace "" with <u></u> for EN version and bug fixes * Fix biary_tree_dfs.png * Fix biary_tree_dfs.png * Fix zh-hant/biary_tree_dfs.png * Fix heap_sort_step1.png * Sync zh and zh-hant versions. * Bug fixes * Fix EN figures * Bug fixes * Fix the figure labels for EN version
This commit is contained in:
@@ -40,7 +40,7 @@ Comparing the code for the two problems, the state transition changes from $i-1$
|
||||
|
||||
Since the current state comes from the state to the left and above, **the space-optimized solution should perform a forward traversal for each row in the $dp$ table**.
|
||||
|
||||
This traversal order is the opposite of that for the 0-1 knapsack. Please refer to the following figures to understand the difference.
|
||||
This traversal order is the opposite of that for the 0-1 knapsack. Please refer to the figure below to understand the difference.
|
||||
|
||||
=== "<1>"
|
||||

|
||||
@@ -117,7 +117,7 @@ For this reason, we use the number $amt + 1$ to represent an invalid solution, b
|
||||
[file]{coin_change}-[class]{}-[func]{coin_change_dp}
|
||||
```
|
||||
|
||||
The following images show the dynamic programming process for the coin change problem, which is very similar to the unbounded knapsack problem.
|
||||
The figure below show the dynamic programming process for the coin change problem, which is very similar to the unbounded knapsack problem.
|
||||
|
||||
=== "<1>"
|
||||

|
||||
@@ -176,7 +176,7 @@ The space optimization for the coin change problem is handled in the same way as
|
||||
|
||||
!!! question
|
||||
|
||||
Given $n$ types of coins, where the denomination of the $i^{th}$ type of coin is $coins[i - 1]$, and the target amount is $amt$. **Each type of coin can be selected multiple times**, **ask how many combinations of coins can make up the target amount**. See the example below.
|
||||
Given $n$ types of coins, where the denomination of the $i^{th}$ type of coin is $coins[i - 1]$, and the target amount is $amt$. Each type of coin can be selected multiple times, **ask how many combinations of coins can make up the target amount**. See the example below.
|
||||
|
||||

|
||||
|
||||
|
||||
Reference in New Issue
Block a user