try to push this time

main
Anastasia Kisner 2024-11-08 20:26:58 +01:00
parent 72ff38beb9
commit 0c0d74c00e
1 changed files with 4 additions and 11 deletions

View File

@ -1,17 +1,12 @@
const std = @import("std");
pub fn LLIst (comptime T: type) type {
pub fn LList (comptime T: type) type {
return struct {
const Self = @This();
first: *Node(T),
//TODO Liste mit allen Nodes erstellen
first: ?*Node(T),
pub fn init(this: *Self) !void {
//TODO Heap mit allocater nutzen
var node: Node(T) = undefined;
node.init(69);
try node.printNode();
this.first = &node;
pub fn init(this: *Self) !void { // ! allocator: *std.mem.allocator als zweiter Parameter
this.first = null;
}
pub fn deinit() void {
@ -25,8 +20,6 @@ pub fn Node (comptime T: type) type {
const Self = @This();
next: *Self, //? Nächste Node in der Liste
position: i64, //? Position der Node in der List, später übergeben mit zB List.len
value: T,
pub fn init(this: *Self, value: T) void {
this.value = value;