Documentation
¶
Index ¶
Examples ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Queue ¶
type Queue[T any] struct { // contains filtered or unexported fields }
func (*Queue[T]) Add ¶
func (q *Queue[T]) Add(data T)
Example ¶
q := Queue[int]{} q.Add(1) q.Add(2) q.Add(3)
Output:
func (*Queue[T]) IsEmpty ¶
Example ¶
q := Queue[int]{} q.Add(1) q.Add(2) fmt.Println(q.IsEmpty()) // Output: false q.Remove() q.Remove() fmt.Println(q.IsEmpty())
Output: true
Click to show internal directories.
Click to hide internal directories.