mirror of
https://github.com/krahets/hello-algo.git
synced 2026-07-21 11:06:07 +00:00
zig : upgrade codes && rust : add codes for chapter_searching and chapter_dynamic_programming. (#591)
* zig : update zig codes * rust : add codes for linear_search and hashing_search * rust : add codes for linear_search and hashing_search * rust : add codes for chapter_dynamic_programming
This commit is contained in:
@@ -38,7 +38,7 @@ pub fn AVLTree(comptime T: type) type {
|
||||
// 更新节点高度
|
||||
fn updateHeight(self: *Self, node: ?*inc.TreeNode(T)) void {
|
||||
// 节点高度等于最高子树高度 + 1
|
||||
node.?.height = std.math.max(self.height(node.?.left), self.height(node.?.right)) + 1;
|
||||
node.?.height = @max(self.height(node.?.left), self.height(node.?.right)) + 1;
|
||||
}
|
||||
|
||||
// 获取平衡因子
|
||||
|
||||
Reference in New Issue
Block a user