mirror of
https://github.com/duke-git/lancet.git
synced 2026-02-16 02:32:28 +08:00
refactor: rename linknode.go to node.go
This commit is contained in:
@@ -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}
|
|
||||||
}
|
|
||||||
|
|
||||||
@@ -5,7 +5,7 @@ import (
|
|||||||
"fmt"
|
"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 {
|
type SinglyLink[T any] struct {
|
||||||
Head *LinkNode[T]
|
Head *LinkNode[T]
|
||||||
length int
|
length int
|
||||||
|
|||||||
Reference in New Issue
Block a user