1
0
mirror of https://github.com/duke-git/lancet.git synced 2026-02-07 22:22:29 +08:00

feat: add stacklink.go implements stack with link

This commit is contained in:
dudaodong
2022-02-04 22:42:51 +08:00
parent eb59d02a08
commit cee9bb538f
4 changed files with 174 additions and 2 deletions

View File

@@ -15,7 +15,7 @@ func NewLinkNode[T any](value T) *LinkNode[T] {
// StackNode is a node in stack, which have a Value and Pre points to previous node in the stack.
type StackNode[T any] struct {
Value T
Pre *StackNode[T]
Next *StackNode[T]
}
// NewStackNode return a StackNode pointer