mirror of
https://github.com/krahets/hello-algo.git
synced 2026-07-10 22:46:07 +00:00
Update the coding style for Zig (#336)
* Update the coding style for Zig * Update array.rs
This commit is contained in:
@@ -76,6 +76,5 @@ pub fn main() !void {
|
||||
std.debug.print("\n输入列表并建立小顶堆后\n", .{});
|
||||
try inc.PrintUtil.printHeap(i32, mem_allocator, minHeap);
|
||||
|
||||
const getchar = try std.io.getStdIn().reader().readByte();
|
||||
_ = getchar;
|
||||
_ = try std.io.getStdIn().reader().readByte();
|
||||
}
|
||||
@@ -6,7 +6,6 @@ const std = @import("std");
|
||||
const inc = @import("include");
|
||||
|
||||
// 堆类简易实现
|
||||
// 编译期泛型
|
||||
pub fn MaxHeap(comptime T: type) type {
|
||||
return struct {
|
||||
const Self = @This();
|
||||
@@ -181,10 +180,9 @@ pub fn main() !void {
|
||||
std.debug.print("\n堆元素数量为 {}", .{size});
|
||||
|
||||
// 判断堆是否为空
|
||||
var isEmpty = maxHeap.isEmpty();
|
||||
std.debug.print("\n堆是否为空 {}\n", .{isEmpty});
|
||||
var is_empty = maxHeap.isEmpty();
|
||||
std.debug.print("\n堆是否为空 {}\n", .{is_empty});
|
||||
|
||||
const getchar = try std.io.getStdIn().reader().readByte();
|
||||
_ = getchar;
|
||||
_ = try std.io.getStdIn().reader().readByte();
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user