package
Version:
v1.1.9
Opens a new window with list of versions in this module.
Published: Feb 23, 2024
License: MIT
Opens a new window with license information.
Imports: 1
Opens a new window with list of imports.
Imported by: 0
Opens a new window with list of known importers.
Documentation
¶
type Queue[T any] struct {
}
func NewFrom[T any](values ...T) *Queue[T]
NewFrom 从切片创建队列
func (c *Queue[T]) Pop() (value T)
Pop 从队列头部弹出元素
func (c *Queue[T]) Push(v T)
Push 追加元素到队列尾部
func (c *Queue[T]) Range(f func(value T) bool)
Range 遍历
func (c *Queue[T]) Reset()
Reset 重置
func (c *Queue[T]) UnWrap() []T
UnWrap 解包, 返回底层数组
Source Files
¶
Click to show internal directories.
Click to hide internal directories.