update zig codes for Section 'Space Complexity' and 'Space Time Tradeoff'

This commit is contained in:
sjinzh
2023-01-10 17:19:21 +08:00
parent 2d461b03a4
commit 2572b83540
8 changed files with 23 additions and 4 deletions

View File

@@ -7,6 +7,7 @@ const ListNode = @import("ListNode.zig").ListNode;
const TreeNode = @import("TreeNode.zig").TreeNode;
// Print an array
// 编译期泛型
pub fn printArray(comptime T: type, nums: []T) void {
std.debug.print("[", .{});
if (nums.len > 0) {