1
0
mirror of https://github.com/duke-git/lancet.git synced 2026-02-06 21:52:28 +08:00

feat: add singlelink

This commit is contained in:
dudaodong
2022-01-26 15:25:02 +08:00
parent 887eaa528a
commit 957e6356f6

View File

@@ -0,0 +1,12 @@
package datastructure
// Node is a linkedlist node, which have a value and Pre points to previous node, Next points to a next node of the link.
type Node[T any] struct {
Value T
Pre *Node[T]
Next *Node[T]
}
func NewNode[T any](value T) *Node[T] {
return &Node[T]{value, nil, nil}
}