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

@ -10,7 +10,7 @@ import include.*;
/* AVL 树 */
class AVLTree {
TreeNode root; // 根
TreeNode root; // 根
/* 获取结点高度 */
public int height(TreeNode node) {
@ -42,7 +42,7 @@ class AVLTree {
// 更新结点高度
updateHeight(node);
updateHeight(child);
// 返回旋转后子树的根
// 返回旋转后子树的根
return child;
}
@ -56,7 +56,7 @@ class AVLTree {
// 更新结点高度
updateHeight(node);
updateHeight(child);
// 返回旋转后子树的根
// 返回旋转后子树的根
return child;
}
@ -109,7 +109,7 @@ class AVLTree {
updateHeight(node); // 更新结点高度
/* 2. 执行旋转操作,使该子树重新恢复平衡 */
node = rotate(node);
// 返回子树的根
// 返回子树的根
return node;
}
@ -146,7 +146,7 @@ class AVLTree {
updateHeight(node); // 更新结点高度
/* 2. 执行旋转操作,使该子树重新恢复平衡 */
node = rotate(node);
// 返回子树的根
// 返回子树的根
return node;
}

View File

@ -18,7 +18,7 @@ public class binary_tree_bfs {
List<Integer> list = new ArrayList<>();
while (!queue.isEmpty()) {
TreeNode node = queue.poll(); // 队列出队
list.add(node.val); // 保存结点
list.add(node.val); // 保存结点
if (node.left != null)
queue.offer(node.left); // 左子结点入队
if (node.right != null)