mirror of
https://github.com/duke-git/lancet.git
synced 2025-10-19 13:54:34 +08:00
14 lines
320 B
Go
14 lines
320 B
Go
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}
|
|
}
|
|
|