ds/impl_stack_linked_list.go

14 lines
266 B
Go
Raw Normal View History

2023-01-20 21:48:46 +01:00
package ds
2023-01-20 22:05:08 +01:00
type LinkedListStack[T any] struct {
*ListStack[T, *LinkedList[T]]
2023-01-20 22:05:08 +01:00
}
var _ Stack[int] = &LinkedListStack[int]{}
2023-01-20 21:48:46 +01:00
2023-01-20 22:05:08 +01:00
func NewLinkedListStack[T any]() *LinkedListStack[T] {
return &LinkedListStack[T]{
ListStack: NewListStack[T](NewLinkedList[T]()),
}
2023-01-20 21:48:46 +01:00
}