ds/impl_stack_array.go

14 lines
240 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 ArrayStack[T any] struct {
*ListStack[T, *ArrayList[T]]
2023-01-20 22:05:08 +01:00
}
var _ Stack[int] = &ArrayStack[int]{}
2023-01-20 21:48:46 +01:00
func NewArrayStack[T any]() *ArrayStack[T] {
2023-01-20 22:05:08 +01:00
return &ArrayStack[T]{
ListStack: NewListStack[T](NewArrayList[T](0)),
}
2023-01-20 21:48:46 +01:00
}