slice

package
v0.0.0-...-e494a0c Latest Latest
Warning

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

Go to latest
Published: Sep 10, 2018 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func HeapReverse

func HeapReverse(data heap.Interface) heap.Interface

HeapReverse same as sort.Reverse for heap

Types

type Coordinate

type Coordinate struct {
	I int
	J int
}

Coordinate is used to describe I and J grid index

type MaxHeapSliceBool

type MaxHeapSliceBool struct {
	Slice *SliceBool
}

MaxHeapSliceBool struct for max heap

func (MaxHeapSliceBool) Fix

func (hp MaxHeapSliceBool) Fix(i int)

Fix re-establishes heap ordering after i has changed value

func (MaxHeapSliceBool) Max

func (hp MaxHeapSliceBool) Max() bool

Max returns max element

func (MaxHeapSliceBool) Pop

func (hp MaxHeapSliceBool) Pop() bool

Pop removes the minimum element

func (MaxHeapSliceBool) Push

func (hp MaxHeapSliceBool) Push(v bool)

Push v to heap

func (MaxHeapSliceBool) Remove

func (hp MaxHeapSliceBool) Remove(i int) bool

Remove i-th element

type MaxHeapSliceByte

type MaxHeapSliceByte struct {
	Slice *SliceByte
}

MaxHeapSliceByte struct for max heap

func (MaxHeapSliceByte) Fix

func (hp MaxHeapSliceByte) Fix(i int)

Fix re-establishes heap ordering after i has changed value

func (MaxHeapSliceByte) Max

func (hp MaxHeapSliceByte) Max() byte

Max returns max element

func (MaxHeapSliceByte) Pop

func (hp MaxHeapSliceByte) Pop() byte

Pop removes the minimum element

func (MaxHeapSliceByte) Push

func (hp MaxHeapSliceByte) Push(v byte)

Push v to heap

func (MaxHeapSliceByte) Remove

func (hp MaxHeapSliceByte) Remove(i int) byte

Remove i-th element

type MaxHeapSliceFloat64

type MaxHeapSliceFloat64 struct {
	Slice *SliceFloat64
}

MaxHeapSliceFloat64 struct for max heap

func (MaxHeapSliceFloat64) Fix

func (hp MaxHeapSliceFloat64) Fix(i int)

Fix re-establishes heap ordering after i has changed value

func (MaxHeapSliceFloat64) Max

func (hp MaxHeapSliceFloat64) Max() float64

Max returns max element

func (MaxHeapSliceFloat64) Pop

func (hp MaxHeapSliceFloat64) Pop() float64

Pop removes the minimum element

func (MaxHeapSliceFloat64) Push

func (hp MaxHeapSliceFloat64) Push(v float64)

Push v to heap

func (MaxHeapSliceFloat64) Remove

func (hp MaxHeapSliceFloat64) Remove(i int) float64

Remove i-th element

type MaxHeapSliceInt

type MaxHeapSliceInt struct {
	Slice *SliceInt
}

MaxHeapSliceInt struct for max heap

func (MaxHeapSliceInt) Fix

func (hp MaxHeapSliceInt) Fix(i int)

Fix re-establishes heap ordering after i has changed value

func (MaxHeapSliceInt) Max

func (hp MaxHeapSliceInt) Max() int

Max returns max element

func (MaxHeapSliceInt) Pop

func (hp MaxHeapSliceInt) Pop() int

Pop removes the minimum element

func (MaxHeapSliceInt) Push

func (hp MaxHeapSliceInt) Push(v int)

Push v to heap

func (MaxHeapSliceInt) Remove

func (hp MaxHeapSliceInt) Remove(i int) int

Remove i-th element

type MaxHeapSliceSliceBool

type MaxHeapSliceSliceBool struct {
	Slice *SliceSliceBool
}

MaxHeapSliceSliceBool struct for max heap

func (MaxHeapSliceSliceBool) Fix

func (hp MaxHeapSliceSliceBool) Fix(i int)

Fix re-establishes heap ordering after i has changed value

func (MaxHeapSliceSliceBool) Max

Max returns max element

func (MaxHeapSliceSliceBool) Pop

Pop removes the minimum element

func (MaxHeapSliceSliceBool) Push

func (hp MaxHeapSliceSliceBool) Push(v SliceBool)

Push v to heap

func (MaxHeapSliceSliceBool) Remove

func (hp MaxHeapSliceSliceBool) Remove(i int) SliceBool

Remove i-th element

type MaxHeapSliceSliceByte

type MaxHeapSliceSliceByte struct {
	Slice *SliceSliceByte
}

MaxHeapSliceSliceByte struct for max heap

func (MaxHeapSliceSliceByte) Fix

func (hp MaxHeapSliceSliceByte) Fix(i int)

Fix re-establishes heap ordering after i has changed value

func (MaxHeapSliceSliceByte) Max

Max returns max element

func (MaxHeapSliceSliceByte) Pop

Pop removes the minimum element

func (MaxHeapSliceSliceByte) Push

func (hp MaxHeapSliceSliceByte) Push(v SliceByte)

Push v to heap

func (MaxHeapSliceSliceByte) Remove

func (hp MaxHeapSliceSliceByte) Remove(i int) SliceByte

Remove i-th element

type MaxHeapSliceSliceFloat64

type MaxHeapSliceSliceFloat64 struct {
	Slice *SliceSliceFloat64
}

MaxHeapSliceSliceFloat64 struct for max heap

func (MaxHeapSliceSliceFloat64) Fix

func (hp MaxHeapSliceSliceFloat64) Fix(i int)

Fix re-establishes heap ordering after i has changed value

func (MaxHeapSliceSliceFloat64) Max

Max returns max element

func (MaxHeapSliceSliceFloat64) Pop

Pop removes the minimum element

func (MaxHeapSliceSliceFloat64) Push

Push v to heap

func (MaxHeapSliceSliceFloat64) Remove

Remove i-th element

type MaxHeapSliceSliceInt

type MaxHeapSliceSliceInt struct {
	Slice *SliceSliceInt
}

MaxHeapSliceSliceInt struct for max heap

func (MaxHeapSliceSliceInt) Fix

func (hp MaxHeapSliceSliceInt) Fix(i int)

Fix re-establishes heap ordering after i has changed value

func (MaxHeapSliceSliceInt) Max

func (hp MaxHeapSliceSliceInt) Max() SliceInt

Max returns max element

func (MaxHeapSliceSliceInt) Pop

func (hp MaxHeapSliceSliceInt) Pop() SliceInt

Pop removes the minimum element

func (MaxHeapSliceSliceInt) Push

func (hp MaxHeapSliceSliceInt) Push(v SliceInt)

Push v to heap

func (MaxHeapSliceSliceInt) Remove

func (hp MaxHeapSliceSliceInt) Remove(i int) SliceInt

Remove i-th element

type MaxHeapSliceSliceString

type MaxHeapSliceSliceString struct {
	Slice *SliceSliceString
}

MaxHeapSliceSliceString struct for max heap

func (MaxHeapSliceSliceString) Fix

func (hp MaxHeapSliceSliceString) Fix(i int)

Fix re-establishes heap ordering after i has changed value

func (MaxHeapSliceSliceString) Max

Max returns max element

func (MaxHeapSliceSliceString) Pop

Pop removes the minimum element

func (MaxHeapSliceSliceString) Push

Push v to heap

func (MaxHeapSliceSliceString) Remove

Remove i-th element

type MaxHeapSliceString

type MaxHeapSliceString struct {
	Slice *SliceString
}

MaxHeapSliceString struct for max heap

func (MaxHeapSliceString) Fix

func (hp MaxHeapSliceString) Fix(i int)

Fix re-establishes heap ordering after i has changed value

func (MaxHeapSliceString) Max

func (hp MaxHeapSliceString) Max() string

Max returns max element

func (MaxHeapSliceString) Pop

func (hp MaxHeapSliceString) Pop() string

Pop removes the minimum element

func (MaxHeapSliceString) Push

func (hp MaxHeapSliceString) Push(v string)

Push v to heap

func (MaxHeapSliceString) Remove

func (hp MaxHeapSliceString) Remove(i int) string

Remove i-th element

type MinHeapSliceBool

type MinHeapSliceBool struct {
	Slice *SliceBool
}

MinHeapSliceBool struct for min heap

func (MinHeapSliceBool) Fix

func (hp MinHeapSliceBool) Fix(i int)

Fix re-establishes heap ordering after i has changed value

func (MinHeapSliceBool) Min

func (hp MinHeapSliceBool) Min() bool

Min returns min element

func (MinHeapSliceBool) Pop

func (hp MinHeapSliceBool) Pop() bool

Pop removes the minimum element

func (MinHeapSliceBool) Push

func (hp MinHeapSliceBool) Push(v bool)

Push v to heap

func (MinHeapSliceBool) Remove

func (hp MinHeapSliceBool) Remove(i int) bool

Remove i-th element

type MinHeapSliceByte

type MinHeapSliceByte struct {
	Slice *SliceByte
}

MinHeapSliceByte struct for min heap

func (MinHeapSliceByte) Fix

func (hp MinHeapSliceByte) Fix(i int)

Fix re-establishes heap ordering after i has changed value

func (MinHeapSliceByte) Min

func (hp MinHeapSliceByte) Min() byte

Min returns min element

func (MinHeapSliceByte) Pop

func (hp MinHeapSliceByte) Pop() byte

Pop removes the minimum element

func (MinHeapSliceByte) Push

func (hp MinHeapSliceByte) Push(v byte)

Push v to heap

func (MinHeapSliceByte) Remove

func (hp MinHeapSliceByte) Remove(i int) byte

Remove i-th element

type MinHeapSliceFloat64

type MinHeapSliceFloat64 struct {
	Slice *SliceFloat64
}

MinHeapSliceFloat64 struct for min heap

func (MinHeapSliceFloat64) Fix

func (hp MinHeapSliceFloat64) Fix(i int)

Fix re-establishes heap ordering after i has changed value

func (MinHeapSliceFloat64) Min

func (hp MinHeapSliceFloat64) Min() float64

Min returns min element

func (MinHeapSliceFloat64) Pop

func (hp MinHeapSliceFloat64) Pop() float64

Pop removes the minimum element

func (MinHeapSliceFloat64) Push

func (hp MinHeapSliceFloat64) Push(v float64)

Push v to heap

func (MinHeapSliceFloat64) Remove

func (hp MinHeapSliceFloat64) Remove(i int) float64

Remove i-th element

type MinHeapSliceInt

type MinHeapSliceInt struct {
	Slice *SliceInt
}

MinHeapSliceInt struct for min heap

func (MinHeapSliceInt) Fix

func (hp MinHeapSliceInt) Fix(i int)

Fix re-establishes heap ordering after i has changed value

func (MinHeapSliceInt) Min

func (hp MinHeapSliceInt) Min() int

Min returns min element

func (MinHeapSliceInt) Pop

func (hp MinHeapSliceInt) Pop() int

Pop removes the minimum element

func (MinHeapSliceInt) Push

func (hp MinHeapSliceInt) Push(v int)

Push v to heap

func (MinHeapSliceInt) Remove

func (hp MinHeapSliceInt) Remove(i int) int

Remove i-th element

type MinHeapSliceSliceBool

type MinHeapSliceSliceBool struct {
	Slice *SliceSliceBool
}

MinHeapSliceSliceBool struct for min heap

func (MinHeapSliceSliceBool) Fix

func (hp MinHeapSliceSliceBool) Fix(i int)

Fix re-establishes heap ordering after i has changed value

func (MinHeapSliceSliceBool) Min

Min returns min element

func (MinHeapSliceSliceBool) Pop

Pop removes the minimum element

func (MinHeapSliceSliceBool) Push

func (hp MinHeapSliceSliceBool) Push(v SliceBool)

Push v to heap

func (MinHeapSliceSliceBool) Remove

func (hp MinHeapSliceSliceBool) Remove(i int) SliceBool

Remove i-th element

type MinHeapSliceSliceByte

type MinHeapSliceSliceByte struct {
	Slice *SliceSliceByte
}

MinHeapSliceSliceByte struct for min heap

func (MinHeapSliceSliceByte) Fix

func (hp MinHeapSliceSliceByte) Fix(i int)

Fix re-establishes heap ordering after i has changed value

func (MinHeapSliceSliceByte) Min

Min returns min element

func (MinHeapSliceSliceByte) Pop

Pop removes the minimum element

func (MinHeapSliceSliceByte) Push

func (hp MinHeapSliceSliceByte) Push(v SliceByte)

Push v to heap

func (MinHeapSliceSliceByte) Remove

func (hp MinHeapSliceSliceByte) Remove(i int) SliceByte

Remove i-th element

type MinHeapSliceSliceFloat64

type MinHeapSliceSliceFloat64 struct {
	Slice *SliceSliceFloat64
}

MinHeapSliceSliceFloat64 struct for min heap

func (MinHeapSliceSliceFloat64) Fix

func (hp MinHeapSliceSliceFloat64) Fix(i int)

Fix re-establishes heap ordering after i has changed value

func (MinHeapSliceSliceFloat64) Min

Min returns min element

func (MinHeapSliceSliceFloat64) Pop

Pop removes the minimum element

func (MinHeapSliceSliceFloat64) Push

Push v to heap

func (MinHeapSliceSliceFloat64) Remove

Remove i-th element

type MinHeapSliceSliceInt

type MinHeapSliceSliceInt struct {
	Slice *SliceSliceInt
}

MinHeapSliceSliceInt struct for min heap

func (MinHeapSliceSliceInt) Fix

func (hp MinHeapSliceSliceInt) Fix(i int)

Fix re-establishes heap ordering after i has changed value

func (MinHeapSliceSliceInt) Min

func (hp MinHeapSliceSliceInt) Min() SliceInt

Min returns min element

func (MinHeapSliceSliceInt) Pop

func (hp MinHeapSliceSliceInt) Pop() SliceInt

Pop removes the minimum element

func (MinHeapSliceSliceInt) Push

func (hp MinHeapSliceSliceInt) Push(v SliceInt)

Push v to heap

func (MinHeapSliceSliceInt) Remove

func (hp MinHeapSliceSliceInt) Remove(i int) SliceInt

Remove i-th element

type MinHeapSliceSliceString

type MinHeapSliceSliceString struct {
	Slice *SliceSliceString
}

MinHeapSliceSliceString struct for min heap

func (MinHeapSliceSliceString) Fix

func (hp MinHeapSliceSliceString) Fix(i int)

Fix re-establishes heap ordering after i has changed value

func (MinHeapSliceSliceString) Min

Min returns min element

func (MinHeapSliceSliceString) Pop

Pop removes the minimum element

func (MinHeapSliceSliceString) Push

Push v to heap

func (MinHeapSliceSliceString) Remove

Remove i-th element

type MinHeapSliceString

type MinHeapSliceString struct {
	Slice *SliceString
}

MinHeapSliceString struct for min heap

func (MinHeapSliceString) Fix

func (hp MinHeapSliceString) Fix(i int)

Fix re-establishes heap ordering after i has changed value

func (MinHeapSliceString) Min

func (hp MinHeapSliceString) Min() string

Min returns min element

func (MinHeapSliceString) Pop

func (hp MinHeapSliceString) Pop() string

Pop removes the minimum element

func (MinHeapSliceString) Push

func (hp MinHeapSliceString) Push(v string)

Push v to heap

func (MinHeapSliceString) Remove

func (hp MinHeapSliceString) Remove(i int) string

Remove i-th element

type SliceBool

type SliceBool []bool

SliceBool type

func NewSliceBool

func NewSliceBool(n int) SliceBool

NewSliceBool creates slice length n

func (*SliceBool) Append

func (slice *SliceBool) Append(values ...bool)

Append values

func (SliceBool) Copy

func (slice SliceBool) Copy() SliceBool

Copy makes a new independent copy of slice

func (SliceBool) Get

func (slice SliceBool) Get(i int) bool

Get i-th element

func (SliceBool) Len

func (slice SliceBool) Len() int

Len length

func (SliceBool) Less

func (slice SliceBool) Less(i, j int) bool

func (*SliceBool) MaxHeap

func (slice *SliceBool) MaxHeap() MaxHeapSliceBool

MaxHeap returns struct with max heap functionality based on SliceBool

func (*SliceBool) MinHeap

func (slice *SliceBool) MinHeap() MinHeapSliceBool

MinHeap returns struct with min heap functionality based on SliceBool

func (*SliceBool) Pop

func (slice *SliceBool) Pop() interface{}

Pop element

func (*SliceBool) Prepend

func (slice *SliceBool) Prepend(values ...bool)

Prepend values

func (SliceBool) Print

func (slice SliceBool) Print(sep string) string

Print prints using separator

func (*SliceBool) Push

func (slice *SliceBool) Push(c interface{})

Push element

func (SliceBool) Set

func (slice SliceBool) Set(c bool)

Set sets all element to c

func (SliceBool) SortAsc

func (slice SliceBool) SortAsc()

SortAsc sort ascending

func (SliceBool) SortDesc

func (slice SliceBool) SortDesc()

SortDesc sort descending

func (SliceBool) String

func (slice SliceBool) String() string

String is for print

func (SliceBool) Swap

func (slice SliceBool) Swap(i, j int)

Swap two elements

type SliceByte

type SliceByte []byte

SliceByte type

func NewSliceByte

func NewSliceByte(n int) SliceByte

NewSliceByte creates slice length n

func (*SliceByte) Append

func (slice *SliceByte) Append(values ...byte)

Append values

func (SliceByte) Copy

func (slice SliceByte) Copy() SliceByte

Copy makes a new independent copy of slice

func (SliceByte) Get

func (slice SliceByte) Get(i int) byte

Get i-th element

func (SliceByte) Len

func (slice SliceByte) Len() int

Len length

func (SliceByte) Less

func (slice SliceByte) Less(i, j int) bool

func (*SliceByte) MaxHeap

func (slice *SliceByte) MaxHeap() MaxHeapSliceByte

MaxHeap returns struct with max heap functionality based on SliceByte

func (*SliceByte) MinHeap

func (slice *SliceByte) MinHeap() MinHeapSliceByte

MinHeap returns struct with min heap functionality based on SliceByte

func (*SliceByte) Pop

func (slice *SliceByte) Pop() interface{}

Pop element

func (*SliceByte) Prepend

func (slice *SliceByte) Prepend(values ...byte)

Prepend values

func (SliceByte) Print

func (slice SliceByte) Print(sep string) string

Print prints using separator

func (*SliceByte) Push

func (slice *SliceByte) Push(c interface{})

Push element

func (SliceByte) Set

func (slice SliceByte) Set(c byte)

Set sets all element to c

func (SliceByte) SortAsc

func (slice SliceByte) SortAsc()

SortAsc sort ascending

func (SliceByte) SortDesc

func (slice SliceByte) SortDesc()

SortDesc sort descending

func (SliceByte) String

func (slice SliceByte) String() string

String is for print

func (SliceByte) Swap

func (slice SliceByte) Swap(i, j int)

Swap two elements

type SliceFloat64

type SliceFloat64 []float64

SliceFloat64 type

func NewSliceFloat64

func NewSliceFloat64(n int) SliceFloat64

NewSliceFloat64 creates slice length n

func (*SliceFloat64) Append

func (slice *SliceFloat64) Append(values ...float64)

Append values

func (SliceFloat64) Copy

func (slice SliceFloat64) Copy() SliceFloat64

Copy makes a new independent copy of slice

func (SliceFloat64) Get

func (slice SliceFloat64) Get(i int) float64

Get i-th element

func (SliceFloat64) Len

func (slice SliceFloat64) Len() int

Len length

func (SliceFloat64) Less

func (slice SliceFloat64) Less(i, j int) bool

func (*SliceFloat64) MaxHeap

func (slice *SliceFloat64) MaxHeap() MaxHeapSliceFloat64

MaxHeap returns struct with max heap functionality based on SliceFloat64

func (*SliceFloat64) MinHeap

func (slice *SliceFloat64) MinHeap() MinHeapSliceFloat64

MinHeap returns struct with min heap functionality based on SliceFloat64

func (*SliceFloat64) Pop

func (slice *SliceFloat64) Pop() interface{}

Pop element

func (*SliceFloat64) Prepend

func (slice *SliceFloat64) Prepend(values ...float64)

Prepend values

func (SliceFloat64) Print

func (slice SliceFloat64) Print(sep string) string

Print prints using separator

func (*SliceFloat64) Push

func (slice *SliceFloat64) Push(c interface{})

Push element

func (SliceFloat64) Set

func (slice SliceFloat64) Set(c float64)

Set sets all element to c

func (SliceFloat64) SortAsc

func (slice SliceFloat64) SortAsc()

SortAsc sort ascending

func (SliceFloat64) SortDesc

func (slice SliceFloat64) SortDesc()

SortDesc sort descending

func (SliceFloat64) String

func (slice SliceFloat64) String() string

String is for print

func (SliceFloat64) Swap

func (slice SliceFloat64) Swap(i, j int)

Swap two elements

type SliceInt

type SliceInt []int

SliceInt type

func NewSliceInt

func NewSliceInt(n int) SliceInt

NewSliceInt creates slice length n

func (*SliceInt) Append

func (slice *SliceInt) Append(values ...int)

Append values

func (SliceInt) Copy

func (slice SliceInt) Copy() SliceInt

Copy makes a new independent copy of slice

func (SliceInt) Get

func (slice SliceInt) Get(i int) int

Get i-th element

func (SliceInt) Len

func (slice SliceInt) Len() int

Len length

func (SliceInt) Less

func (slice SliceInt) Less(i, j int) bool

func (*SliceInt) MaxHeap

func (slice *SliceInt) MaxHeap() MaxHeapSliceInt

MaxHeap returns struct with max heap functionality based on SliceInt

func (*SliceInt) MinHeap

func (slice *SliceInt) MinHeap() MinHeapSliceInt

MinHeap returns struct with min heap functionality based on SliceInt

func (*SliceInt) Pop

func (slice *SliceInt) Pop() interface{}

Pop element

func (*SliceInt) Prepend

func (slice *SliceInt) Prepend(values ...int)

Prepend values

func (SliceInt) Print

func (slice SliceInt) Print(sep string) string

Print prints using separator

func (*SliceInt) Push

func (slice *SliceInt) Push(c interface{})

Push element

func (SliceInt) Set

func (slice SliceInt) Set(c int)

Set sets all element to c

func (SliceInt) SortAsc

func (slice SliceInt) SortAsc()

SortAsc sort ascending

func (SliceInt) SortDesc

func (slice SliceInt) SortDesc()

SortDesc sort descending

func (SliceInt) String

func (slice SliceInt) String() string

String is for print

func (SliceInt) Swap

func (slice SliceInt) Swap(i, j int)

Swap two elements

type SliceSliceBool

type SliceSliceBool []SliceBool

SliceSliceBool type

func NewSliceSliceBool

func NewSliceSliceBool(n, m int) SliceSliceBool

NewSliceSliceBool creates slice length n

func (*SliceSliceBool) Append

func (slice *SliceSliceBool) Append(values ...SliceBool)

Append values

func (SliceSliceBool) Copy

func (slice SliceSliceBool) Copy() SliceSliceBool

Copy makes a new independent copy of slice

func (SliceSliceBool) Get

func (slice SliceSliceBool) Get(i int) SliceBool

Get i-th element

func (SliceSliceBool) Len

func (slice SliceSliceBool) Len() int

Len length

func (SliceSliceBool) Less

func (slice SliceSliceBool) Less(i, j int) bool

func (*SliceSliceBool) MaxHeap

func (slice *SliceSliceBool) MaxHeap() MaxHeapSliceSliceBool

MaxHeap returns struct with max heap functionality based on SliceSliceBool

func (*SliceSliceBool) MinHeap

func (slice *SliceSliceBool) MinHeap() MinHeapSliceSliceBool

MinHeap returns struct with min heap functionality based on SliceSliceBool

func (*SliceSliceBool) Pop

func (slice *SliceSliceBool) Pop() interface{}

Pop element

func (*SliceSliceBool) Prepend

func (slice *SliceSliceBool) Prepend(values ...SliceBool)

Prepend values

func (SliceSliceBool) Print

func (slice SliceSliceBool) Print(sep string) string

Print prints using separator

func (*SliceSliceBool) Push

func (slice *SliceSliceBool) Push(c interface{})

Push element

func (SliceSliceBool) Set

func (slice SliceSliceBool) Set(c SliceBool)

Set sets all element to c

func (SliceSliceBool) SortAsc

func (slice SliceSliceBool) SortAsc()

SortAsc sort ascending

func (SliceSliceBool) SortDesc

func (slice SliceSliceBool) SortDesc()

SortDesc sort descending

func (SliceSliceBool) SpiralIterator

func (slice SliceSliceBool) SpiralIterator() []Coordinate

SpiralIterator returns []Coordinate in spiral order

func (SliceSliceBool) String

func (slice SliceSliceBool) String() string

String is for print

func (SliceSliceBool) Swap

func (slice SliceSliceBool) Swap(i, j int)

Swap two elements

type SliceSliceByte

type SliceSliceByte []SliceByte

SliceSliceByte type

func NewSliceSliceByte

func NewSliceSliceByte(n, m int) SliceSliceByte

NewSliceSliceByte creates slice length n

func (*SliceSliceByte) Append

func (slice *SliceSliceByte) Append(values ...SliceByte)

Append values

func (SliceSliceByte) Copy

func (slice SliceSliceByte) Copy() SliceSliceByte

Copy makes a new independent copy of slice

func (SliceSliceByte) Get

func (slice SliceSliceByte) Get(i int) SliceByte

Get i-th element

func (SliceSliceByte) Len

func (slice SliceSliceByte) Len() int

Len length

func (SliceSliceByte) Less

func (slice SliceSliceByte) Less(i, j int) bool

func (*SliceSliceByte) MaxHeap

func (slice *SliceSliceByte) MaxHeap() MaxHeapSliceSliceByte

MaxHeap returns struct with max heap functionality based on SliceSliceByte

func (*SliceSliceByte) MinHeap

func (slice *SliceSliceByte) MinHeap() MinHeapSliceSliceByte

MinHeap returns struct with min heap functionality based on SliceSliceByte

func (*SliceSliceByte) Pop

func (slice *SliceSliceByte) Pop() interface{}

Pop element

func (*SliceSliceByte) Prepend

func (slice *SliceSliceByte) Prepend(values ...SliceByte)

Prepend values

func (SliceSliceByte) Print

func (slice SliceSliceByte) Print(sep string) string

Print prints using separator

func (*SliceSliceByte) Push

func (slice *SliceSliceByte) Push(c interface{})

Push element

func (SliceSliceByte) Set

func (slice SliceSliceByte) Set(c SliceByte)

Set sets all element to c

func (SliceSliceByte) SortAsc

func (slice SliceSliceByte) SortAsc()

SortAsc sort ascending

func (SliceSliceByte) SortDesc

func (slice SliceSliceByte) SortDesc()

SortDesc sort descending

func (SliceSliceByte) SpiralIterator

func (slice SliceSliceByte) SpiralIterator() []Coordinate

SpiralIterator returns []Coordinate in spiral order

func (SliceSliceByte) String

func (slice SliceSliceByte) String() string

String is for print

func (SliceSliceByte) Swap

func (slice SliceSliceByte) Swap(i, j int)

Swap two elements

type SliceSliceFloat64

type SliceSliceFloat64 []SliceFloat64

SliceSliceFloat64 type

func NewSliceSliceFloat64

func NewSliceSliceFloat64(n, m int) SliceSliceFloat64

NewSliceSliceFloat64 creates slice length n

func (*SliceSliceFloat64) Append

func (slice *SliceSliceFloat64) Append(values ...SliceFloat64)

Append values

func (SliceSliceFloat64) Copy

func (slice SliceSliceFloat64) Copy() SliceSliceFloat64

Copy makes a new independent copy of slice

func (SliceSliceFloat64) Get

func (slice SliceSliceFloat64) Get(i int) SliceFloat64

Get i-th element

func (SliceSliceFloat64) Len

func (slice SliceSliceFloat64) Len() int

Len length

func (SliceSliceFloat64) Less

func (slice SliceSliceFloat64) Less(i, j int) bool

func (*SliceSliceFloat64) MaxHeap

MaxHeap returns struct with max heap functionality based on SliceSliceFloat64

func (*SliceSliceFloat64) MinHeap

MinHeap returns struct with min heap functionality based on SliceSliceFloat64

func (*SliceSliceFloat64) Pop

func (slice *SliceSliceFloat64) Pop() interface{}

Pop element

func (SliceSliceFloat64) PostfixIndex

func (slice SliceSliceFloat64) PostfixIndex()

PostfixIndex insert index of element as last element

func (SliceSliceFloat64) PrefixIndex

func (slice SliceSliceFloat64) PrefixIndex()

PrefixIndex insert index of element as last element

func (*SliceSliceFloat64) Prepend

func (slice *SliceSliceFloat64) Prepend(values ...SliceFloat64)

Prepend values

func (SliceSliceFloat64) Print

func (slice SliceSliceFloat64) Print(sep string) string

Print prints using separator

func (*SliceSliceFloat64) Push

func (slice *SliceSliceFloat64) Push(c interface{})

Push element

func (SliceSliceFloat64) Set

func (slice SliceSliceFloat64) Set(c SliceFloat64)

Set sets all element to c

func (SliceSliceFloat64) SortAsc

func (slice SliceSliceFloat64) SortAsc()

SortAsc sort ascending

func (SliceSliceFloat64) SortDesc

func (slice SliceSliceFloat64) SortDesc()

SortDesc sort descending

func (SliceSliceFloat64) SpiralIterator

func (slice SliceSliceFloat64) SpiralIterator() []Coordinate

SpiralIterator returns []Coordinate in spiral order

func (SliceSliceFloat64) String

func (slice SliceSliceFloat64) String() string

String is for print

func (SliceSliceFloat64) Swap

func (slice SliceSliceFloat64) Swap(i, j int)

Swap two elements

type SliceSliceInt

type SliceSliceInt []SliceInt

SliceSliceInt type

func NewSliceSliceInt

func NewSliceSliceInt(n, m int) SliceSliceInt

NewSliceSliceInt creates slice length n

func (*SliceSliceInt) Append

func (slice *SliceSliceInt) Append(values ...SliceInt)

Append values

func (SliceSliceInt) Copy

func (slice SliceSliceInt) Copy() SliceSliceInt

Copy makes a new independent copy of slice

func (SliceSliceInt) Get

func (slice SliceSliceInt) Get(i int) SliceInt

Get i-th element

func (SliceSliceInt) Len

func (slice SliceSliceInt) Len() int

Len length

func (SliceSliceInt) Less

func (slice SliceSliceInt) Less(i, j int) bool

func (*SliceSliceInt) MaxHeap

func (slice *SliceSliceInt) MaxHeap() MaxHeapSliceSliceInt

MaxHeap returns struct with max heap functionality based on SliceSliceInt

func (*SliceSliceInt) MinHeap

func (slice *SliceSliceInt) MinHeap() MinHeapSliceSliceInt

MinHeap returns struct with min heap functionality based on SliceSliceInt

func (*SliceSliceInt) Pop

func (slice *SliceSliceInt) Pop() interface{}

Pop element

func (SliceSliceInt) PostfixIndex

func (slice SliceSliceInt) PostfixIndex()

PostfixIndex insert index of element as last element

func (SliceSliceInt) PrefixIndex

func (slice SliceSliceInt) PrefixIndex()

PrefixIndex insert index of element as last element

func (*SliceSliceInt) Prepend

func (slice *SliceSliceInt) Prepend(values ...SliceInt)

Prepend values

func (SliceSliceInt) Print

func (slice SliceSliceInt) Print(sep string) string

Print prints using separator

func (*SliceSliceInt) Push

func (slice *SliceSliceInt) Push(c interface{})

Push element

func (SliceSliceInt) Set

func (slice SliceSliceInt) Set(c SliceInt)

Set sets all element to c

func (SliceSliceInt) SortAsc

func (slice SliceSliceInt) SortAsc()

SortAsc sort ascending

func (SliceSliceInt) SortDesc

func (slice SliceSliceInt) SortDesc()

SortDesc sort descending

func (SliceSliceInt) SpiralIterator

func (slice SliceSliceInt) SpiralIterator() []Coordinate

SpiralIterator returns []Coordinate in spiral order

func (SliceSliceInt) String

func (slice SliceSliceInt) String() string

String is for print

func (SliceSliceInt) Swap

func (slice SliceSliceInt) Swap(i, j int)

Swap two elements

type SliceSliceString

type SliceSliceString []SliceString

SliceSliceString type

func NewSliceSliceString

func NewSliceSliceString(n, m int) SliceSliceString

NewSliceSliceString creates slice length n

func (*SliceSliceString) Append

func (slice *SliceSliceString) Append(values ...SliceString)

Append values

func (SliceSliceString) Copy

func (slice SliceSliceString) Copy() SliceSliceString

Copy makes a new independent copy of slice

func (SliceSliceString) Get

func (slice SliceSliceString) Get(i int) SliceString

Get i-th element

func (SliceSliceString) Len

func (slice SliceSliceString) Len() int

Len length

func (SliceSliceString) Less

func (slice SliceSliceString) Less(i, j int) bool

func (*SliceSliceString) MaxHeap

func (slice *SliceSliceString) MaxHeap() MaxHeapSliceSliceString

MaxHeap returns struct with max heap functionality based on SliceSliceString

func (*SliceSliceString) MinHeap

func (slice *SliceSliceString) MinHeap() MinHeapSliceSliceString

MinHeap returns struct with min heap functionality based on SliceSliceString

func (*SliceSliceString) Pop

func (slice *SliceSliceString) Pop() interface{}

Pop element

func (*SliceSliceString) Prepend

func (slice *SliceSliceString) Prepend(values ...SliceString)

Prepend values

func (SliceSliceString) Print

func (slice SliceSliceString) Print(sep string) string

Print prints using separator

func (*SliceSliceString) Push

func (slice *SliceSliceString) Push(c interface{})

Push element

func (SliceSliceString) Set

func (slice SliceSliceString) Set(c SliceString)

Set sets all element to c

func (SliceSliceString) SortAsc

func (slice SliceSliceString) SortAsc()

SortAsc sort ascending

func (SliceSliceString) SortDesc

func (slice SliceSliceString) SortDesc()

SortDesc sort descending

func (SliceSliceString) SpiralIterator

func (slice SliceSliceString) SpiralIterator() []Coordinate

SpiralIterator returns []Coordinate in spiral order

func (SliceSliceString) String

func (slice SliceSliceString) String() string

String is for print

func (SliceSliceString) Swap

func (slice SliceSliceString) Swap(i, j int)

Swap two elements

type SliceString

type SliceString []string

SliceString type

func NewSliceString

func NewSliceString(n int) SliceString

NewSliceString creates slice length n

func (*SliceString) Append

func (slice *SliceString) Append(values ...string)

Append values

func (SliceString) Copy

func (slice SliceString) Copy() SliceString

Copy makes a new independent copy of slice

func (SliceString) Get

func (slice SliceString) Get(i int) string

Get i-th element

func (SliceString) Len

func (slice SliceString) Len() int

Len length

func (SliceString) Less

func (slice SliceString) Less(i, j int) bool

func (*SliceString) MaxHeap

func (slice *SliceString) MaxHeap() MaxHeapSliceString

MaxHeap returns struct with max heap functionality based on SliceString

func (*SliceString) MinHeap

func (slice *SliceString) MinHeap() MinHeapSliceString

MinHeap returns struct with min heap functionality based on SliceString

func (*SliceString) Pop

func (slice *SliceString) Pop() interface{}

Pop element

func (*SliceString) Prepend

func (slice *SliceString) Prepend(values ...string)

Prepend values

func (SliceString) Print

func (slice SliceString) Print(sep string) string

Print prints using separator

func (*SliceString) Push

func (slice *SliceString) Push(c interface{})

Push element

func (SliceString) Set

func (slice SliceString) Set(c string)

Set sets all element to c

func (SliceString) SortAsc

func (slice SliceString) SortAsc()

SortAsc sort ascending

func (SliceString) SortDesc

func (slice SliceString) SortDesc()

SortDesc sort descending

func (SliceString) String

func (slice SliceString) String() string

String is for print

func (SliceString) Swap

func (slice SliceString) Swap(i, j int)

Swap two elements

type ValueType

type ValueType interface {
	LessThan(ValueType) bool
	GreaterThan(ValueType) bool
}

ValueType genny generic type for slice

func NewValueType

func NewValueType(dimensions ...int) ValueType

NewValueType generic constructor

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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