diff --git a/datastructure/linknode.go b/datastructure/linknode.go deleted file mode 100644 index bf89e31..0000000 --- a/datastructure/linknode.go +++ /dev/null @@ -1,13 +0,0 @@ -package datastructure - -// LinkNode is a linkedlist node, which have a value and Pre points to previous node, Next points to a next node of the link. -type LinkNode[T any] struct { - Value T - Pre *LinkNode[T] - Next *LinkNode[T] -} - -func NewLinkNode[T any](value T) *LinkNode[T] { - return &LinkNode[T]{value, nil, nil} -} - diff --git a/datastructure/singlylink.go b/datastructure/singlylink.go index f63d601..a948206 100644 --- a/datastructure/singlylink.go +++ b/datastructure/singlylink.go @@ -5,7 +5,7 @@ import ( "fmt" ) -// SinglyLink is a linkedlist of node, which have a value and Pre points to previous node, Next points to a next node of the link. +// SinglyLink is a linked list. Whose node has a Value generics and Next pointer points to a next node of the link. type SinglyLink[T any] struct { Head *LinkNode[T] length int