queue

package
v0.0.0-...-4310ded Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 12, 2021 License: Apache-2.0 Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Implementation

type Implementation struct {
	sync.Mutex
	// contains filtered or unexported fields
}

This implementation is not intended to be used directly. Rather appropriate wrapper method should be created that prevent the wrong types from being added

func (*Implementation) Len

func (queue *Implementation) Len() int

Time-Complexity: O(1)

func (*Implementation) Peek

func (queue *Implementation) Peek() Sortable

func (*Implementation) Pop

func (queue *Implementation) Pop() Sortable

Time-Complexity: O(1)

func (*Implementation) Push

func (queue *Implementation) Push(sortable Sortable)

Time-Complexity: O(n)

type Item

type Item struct {
	// contains filtered or unexported fields
}

type Queue

type Queue interface {
	Pop() Sortable
	Peek() Sortable
	Push(sortable Sortable)
	Len() int
}

func NewQueue

func NewQueue() Queue

type Sortable

type Sortable interface {
	Less(b Sortable) bool
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL