mirror of
https://github.com/krahets/hello-algo.git
synced 2026-07-13 23:56:07 +00:00
Bug fixes and improvements (#1252)
* Bug fixes * Fix the landing page of zh-hant version * Bug fixes and add an Q&A for chapter_data_structure * Update the mindmap for zh-hant version
This commit is contained in:
@@ -8,8 +8,6 @@
|
||||
|
||||
/* AVL 树 */
|
||||
class AVLTree {
|
||||
public:
|
||||
TreeNode *root; // 根节点
|
||||
private:
|
||||
/* 更新节点高度 */
|
||||
void updateHeight(TreeNode *node) {
|
||||
@@ -134,6 +132,8 @@ class AVLTree {
|
||||
}
|
||||
|
||||
public:
|
||||
TreeNode *root; // 根节点
|
||||
|
||||
/* 获取节点高度 */
|
||||
int height(TreeNode *node) {
|
||||
// 空节点高度为 -1 ,叶节点高度为 0
|
||||
|
||||
@@ -48,7 +48,7 @@ func coinChangeDPComp(coins []int, amt int) int {
|
||||
}
|
||||
// 状态转移
|
||||
for i := 1; i <= n; i++ {
|
||||
// 倒序遍历
|
||||
// 正序遍历
|
||||
for a := 1; a <= amt; a++ {
|
||||
if coins[i-1] > a {
|
||||
// 若超过目标金额,则不选硬币 i
|
||||
|
||||
@@ -39,7 +39,7 @@ func coinChangeIIDPComp(coins []int, amt int) int {
|
||||
dp[0] = 1
|
||||
// 状态转移
|
||||
for i := 1; i <= n; i++ {
|
||||
// 倒序遍历
|
||||
// 正序遍历
|
||||
for a := 1; a <= amt; a++ {
|
||||
if coins[i-1] > a {
|
||||
// 若超过目标金额,则不选硬币 i
|
||||
|
||||
Reference in New Issue
Block a user