Documentation
¶
Index ¶
- type ProjectMap
- func (mp *ProjectMap) Len() int
- func (mp *ProjectMap) Less(i, j int) bool
- func (mp *ProjectMap) List() []models.Project
- func (mp *ProjectMap) Max() *models.Project
- func (mp *ProjectMap) Pop() interface{}
- func (mp *ProjectMap) Push(v interface{})
- func (mp *ProjectMap) Search(k uint) *models.Project
- func (mp *ProjectMap) Set(v *models.Project)
- func (mp *ProjectMap) String() string
- func (mp *ProjectMap) Swap(i, j int)
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) 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)
Click to show internal directories.
Click to hide internal directories.