From 71434ddc3c050d2385647dca2262ff188d171dd3 Mon Sep 17 00:00:00 2001 From: realxlfd Date: Sat, 20 Apr 2024 16:20:16 +0800 Subject: [PATCH] add a lot --- utils/containers/linked_list/types.go | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100644 utils/containers/linked_list/types.go diff --git a/utils/containers/linked_list/types.go b/utils/containers/linked_list/types.go new file mode 100644 index 0000000..a73c8dd --- /dev/null +++ b/utils/containers/linked_list/types.go @@ -0,0 +1,12 @@ +package llist + +type LinkedList[T any] struct { + size uint + head *Node[T] + tail *Node[T] +} + +type Node[T any] struct { + elem T + next *Node[T] +}