add zig codes for Section 'Array', 'LinkedList' and 'List'

pull/237/head
sjinzh 2 years ago
parent a1579f6f7e
commit 82f9542abe

@ -90,10 +90,6 @@ pub fn find(nums: []i32, target: i32) i32 {
// Driver Code
pub fn main() !void {
// CPU
var native_target_info = try std.zig.system.NativeTargetInfo.detect(std.zig.CrossTarget{});
std.debug.print("Native Info: CPU Arch = {}, OS = {}\n", .{native_target_info.target.cpu.arch, native_target_info.target.os.tag});
//
const size: i32 = 5;
var arr = [_]i32{0} ** size;

@ -46,10 +46,6 @@ pub fn find(node: ?*inc.ListNode(i32), target: i32) i32 {
// Driver Code
pub fn main() !void {
// CPU
var native_target_info = try std.zig.system.NativeTargetInfo.detect(std.zig.CrossTarget{});
std.debug.print("Native Info: CPU Arch = {}, OS = {}\n", .{native_target_info.target.cpu.arch, native_target_info.target.os.tag});
//
//
var n0 = inc.ListNode(i32){.val = 1};

@ -7,10 +7,6 @@ const inc = @import("include");
// Driver Code
pub fn main() !void {
// CPU
var native_target_info = try std.zig.system.NativeTargetInfo.detect(std.zig.CrossTarget{});
std.debug.print("Native Info: CPU Arch = {}, OS = {}\n", .{native_target_info.target.cpu.arch, native_target_info.target.os.tag});
//
var list = std.ArrayList(i32).init(std.heap.page_allocator);
//

@ -126,10 +126,6 @@ pub fn MyList(comptime T: type) type {
// Driver Code
pub fn main() !void {
// CPU
var native_target_info = try std.zig.system.NativeTargetInfo.detect(std.zig.CrossTarget{});
std.debug.print("Native Info: CPU Arch = {}, OS = {}\n", .{native_target_info.target.cpu.arch, native_target_info.target.os.tag});
//
var list = MyList(i32){};
try list.init(std.heap.page_allocator);

Loading…
Cancel
Save