mirror of
https://github.com/krahets/hello-algo.git
synced 2026-04-05 19:50:25 +08:00
Update the coding style for Zig (#336)
* Update the coding style for Zig * Update array.rs
This commit is contained in:
@@ -5,7 +5,6 @@
|
||||
const std = @import("std");
|
||||
|
||||
// Definition for a singly-linked list node
|
||||
// 编译期泛型
|
||||
pub fn ListNode(comptime T: type) type {
|
||||
return struct {
|
||||
const Self = @This();
|
||||
|
||||
@@ -60,7 +60,7 @@ pub fn printQueue(comptime T: type, queue: std.TailQueue(T)) void {
|
||||
}
|
||||
}
|
||||
|
||||
// Print a HashMap
|
||||
// Print a hash map
|
||||
pub fn printHashMap(comptime TKey: type, comptime TValue: type, map: std.AutoHashMap(TKey, TValue)) void {
|
||||
var it = map.iterator();
|
||||
while (it.next()) |kv| {
|
||||
|
||||
@@ -5,7 +5,6 @@
|
||||
const std = @import("std");
|
||||
|
||||
// Definition for a binary tree node
|
||||
// 编译期泛型
|
||||
pub fn TreeNode(comptime T: type) type {
|
||||
return struct {
|
||||
const Self = @This();
|
||||
|
||||
Reference in New Issue
Block a user