GoCollections/collections/Stack.go

14 lines
305 B
Go
Raw Normal View History

2021-05-22 17:10:26 +08:00
package collections
import "github.com/tursom/GoCollections/exceptions"
2022-03-21 11:02:41 +08:00
type Stack[T any] interface {
2021-05-22 17:10:26 +08:00
// Iterator MutableIterable
2022-03-21 11:02:41 +08:00
Iterator() Iterator[T]
2021-05-22 17:10:26 +08:00
// MutableIterator MutableIterable
2022-03-21 11:02:41 +08:00
MutableIterator() MutableIterator[T]
2021-05-22 17:10:26 +08:00
2022-03-21 11:02:41 +08:00
Push(element T) exceptions.Exception
Pop() (T, exceptions.Exception)
2021-05-22 17:10:26 +08:00
}