2023-01-20 21:48:46 +01:00
|
|
|
package ds
|
|
|
|
|
2023-01-20 22:05:08 +01:00
|
|
|
type ArrayStack[T any] struct {
|
2023-07-10 17:16:41 +02:00
|
|
|
*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
|
|
|
}
|