Documentation ¶
Index ¶
- Variables
- func Dequeue[T any](ctx context.Context, ds Queue[T]) (T, bool)
- func Enqueue[T any](ctx context.Context, ds Queue[T], val T) bool
- func Pop[T any](ctx context.Context, ds Stack[T]) (T, bool)
- func Push[T any](ctx context.Context, ds Stack[T], val T) bool
- type DataStructureBase
- type Queue
- type Stack
Constants ¶
This section is empty.
Variables ¶
View Source
var (
ErrOverflow = errors.New("data overflow")
)
Functions ¶
func Enqueue ¶
Enqueue is used as a safe function to write values into queues, ensuring that even if the q is full, we'll try to write the item until the context is done.
Types ¶
type DataStructureBase ¶
DataStructure is the base interface for all data structures.
Click to show internal directories.
Click to hide internal directories.