mem

package
v0.0.0-...-76456f8 Latest Latest
Warning

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

Go to latest
Published: Jun 12, 2014 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ProjectMap

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

A min Priority Queue that guarantees O(1) search. Takes O(2N) space. A heap and map.

func NewProjectMap

func NewProjectMap() *ProjectMap

func (*ProjectMap) Len

func (mp *ProjectMap) Len() int

////////////////////////////////////////////////////////////////////////// All methods below are priority queue related. //////////////////////////////////////////////////////////////////////////

func (*ProjectMap) Less

func (mp *ProjectMap) Less(i, j int) bool

func (*ProjectMap) List

func (mp *ProjectMap) List() []models.Project

func (*ProjectMap) Max

func (mp *ProjectMap) Max() *models.Project

Pop the max element. O(log(n))

func (*ProjectMap) Pop

func (mp *ProjectMap) Pop() interface{}

func (*ProjectMap) Push

func (mp *ProjectMap) Push(v interface{})

func (*ProjectMap) Search

func (mp *ProjectMap) Search(k uint) *models.Project

Search by key. O(1)

func (*ProjectMap) Set

func (mp *ProjectMap) Set(v *models.Project)

Insert a k/v pair. Key being the project's id and value being the project. O(log(n))

func (*ProjectMap) String

func (mp *ProjectMap) String() string

func (*ProjectMap) Swap

func (mp *ProjectMap) Swap(i, j int)

Jump to

Keyboard shortcuts

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