1. Add build script for Java.

2. Add height limitation for code blocks in extra.css.
3. Fix "节点" to "结点".
This commit is contained in:
krahets
2023-02-07 04:43:52 +08:00
parent b14568151c
commit ecbf2d1560
54 changed files with 457 additions and 1633 deletions

View File

@ -4,11 +4,9 @@
* Author: IsChristina (christinaxia77@foxmail.com)
*/
/**
* 合并左子数组和右子数组
* 左子数组区间 [left, mid]
* 右子数组区间 [mid + 1, right]
*/
/* 合并左子数组和右子数组 */
// 左子数组区间 [left, mid]
// 右子数组区间 [mid + 1, right]
function merge(nums, left, mid, right) {
// 初始化辅助数组
let tmp = nums.slice(left, right + 1);

View File

@ -11,7 +11,7 @@ const { printTree } = require("../include/PrintUtil");
class AVLTree {
/*构造函数*/
constructor() {
this.root = null; //根
this.root = null; //根
}
/* 获取结点高度 */
@ -44,7 +44,7 @@ class AVLTree {
// 更新结点高度
this.updateHeight(node);
this.updateHeight(child);
// 返回旋转后子树的根
// 返回旋转后子树的根
return child;
}
@ -58,7 +58,7 @@ class AVLTree {
// 更新结点高度
this.updateHeight(node);
this.updateHeight(child);
// 返回旋转后子树的根
// 返回旋转后子树的根
return child;
}
@ -108,7 +108,7 @@ class AVLTree {
this.updateHeight(node); // 更新结点高度
/* 2. 执行旋转操作,使该子树重新恢复平衡 */
node = this.rotate(node);
// 返回子树的根
// 返回子树的根
return node;
}
@ -141,7 +141,7 @@ class AVLTree {
this.updateHeight(node); // 更新结点高度
/* 2. 执行旋转操作,使该子树重新恢复平衡 */
node = this.rotate(node);
// 返回子树的根
// 返回子树的根
return node;
}

View File

@ -15,7 +15,7 @@ function hierOrder(root) {
let list = [];
while (queue.length) {
let node = queue.shift(); // 队列出队
list.push(node.val); // 保存结点
list.push(node.val); // 保存结点
if (node.left)
queue.push(node.left); // 左子结点入队
if (node.right)