Documentation
¶
Index ¶
- Variables
- func AbsInt(a int) int
- func BinarySearch(min int, max int, worker func(i int) bool, debug bool) int
- func GreatestCommonDivisor(a int, n ...int) int
- func LeastCommonMultiple(a int, n ...int) int
- func MaxInt(a, b int) int
- func MaxIntArrayValue(arr []int) int
- func MinInt(a, b int) int
- func MinIntArrayValue(arr []int) int
- func ParseInt(s string) int
- func ParseInts(str string, delim string) []int
- func ParseStringToIntArray(lines []string) []int
- func Permutations(arr []int) [][]int
- func PrintDayHeader(day int, title string)
- func PrintError(err error)
- func PrintSolution(result interface{})
- func PrintStepHeader(step int)
- func ReadFileAsIntArray(file string) ([]int, error)
- func ReadFileToArray(path string) ([]string, error)
- func ReadFileToString(path string) (string, error)
- type CalleeType
- type Direction
- type LinkElement
- type LinkedList
- func (l *LinkedList) Add(value interface{}) *LinkElement
- func (l *LinkedList) AddAfter(after *LinkElement, value interface{}) *LinkElement
- func (l *LinkedList) Back() *LinkElement
- func (l *LinkedList) Each(iter func(e *LinkElement))
- func (l *LinkedList) EachStartAt(start *LinkElement, iter func(e *LinkElement))
- func (l *LinkedList) Filter(filter func(e *LinkElement) bool) *LinkElement
- func (l *LinkedList) Front() *LinkElement
- func (l *LinkedList) Len() int
- func (l *LinkedList) Remove(e *LinkElement)
- func (l *LinkedList) ToString(transform func(e *LinkElement) string) string
- type PQItem
- type PriorityQueue
- type Queue
- type RegistryType
- type Stack
Constants ¶
This section is empty.
Variables ¶
View Source
var AocYear = 2020
View Source
var Registry = newRegistry()
Functions ¶
func MaxIntArrayValue ¶
func MinIntArrayValue ¶ added in v1.2.0
func ParseStringToIntArray ¶
func Permutations ¶
func PrintDayHeader ¶
noinspection GoUnhandledErrorResult
func ReadFileAsIntArray ¶
func ReadFileToArray ¶
* Read a file and returning the lines as array (without newlines)
func ReadFileToString ¶
* Read a file and returns its content as one string
Types ¶
type CalleeType ¶
type Direction ¶
type Direction string
const EAST Direction = "east"
const NORTH Direction = "north"
const SOUTH Direction = "south"
const WEST Direction = "west"
func NewDirection ¶
type LinkElement ¶ added in v1.3.0
type LinkElement struct {
// contains filtered or unexported fields
}
func (*LinkElement) Next ¶ added in v1.3.0
func (e *LinkElement) Next() *LinkElement
func (*LinkElement) Prev ¶ added in v1.3.0
func (e *LinkElement) Prev() *LinkElement
func (*LinkElement) Value ¶ added in v1.3.0
func (e *LinkElement) Value() interface{}
type LinkedList ¶ added in v1.3.0
type LinkedList struct {
// contains filtered or unexported fields
}
func NewLinkedList ¶ added in v1.3.0
func NewLinkedList(ring bool) *LinkedList
func (*LinkedList) Add ¶ added in v1.3.0
func (l *LinkedList) Add(value interface{}) *LinkElement
func (*LinkedList) AddAfter ¶ added in v1.3.0
func (l *LinkedList) AddAfter(after *LinkElement, value interface{}) *LinkElement
func (*LinkedList) Back ¶ added in v1.3.0
func (l *LinkedList) Back() *LinkElement
func (*LinkedList) Each ¶ added in v1.3.0
func (l *LinkedList) Each(iter func(e *LinkElement))
func (*LinkedList) EachStartAt ¶ added in v1.3.0
func (l *LinkedList) EachStartAt(start *LinkElement, iter func(e *LinkElement))
func (*LinkedList) Filter ¶ added in v1.3.0
func (l *LinkedList) Filter(filter func(e *LinkElement) bool) *LinkElement
func (*LinkedList) Front ¶ added in v1.3.0
func (l *LinkedList) Front() *LinkElement
func (*LinkedList) Len ¶ added in v1.3.0
func (l *LinkedList) Len() int
func (*LinkedList) Remove ¶ added in v1.3.0
func (l *LinkedList) Remove(e *LinkElement)
func (*LinkedList) ToString ¶ added in v1.3.0
func (l *LinkedList) ToString(transform func(e *LinkElement) string) string
type PQItem ¶
type PQItem struct { Value interface{} Priority int // contains filtered or unexported fields }
type PriorityQueue ¶
type PriorityQueue []*PQItem
func (PriorityQueue) Len ¶
func (pq PriorityQueue) Len() int
func (PriorityQueue) Less ¶
func (pq PriorityQueue) Less(i, j int) bool
func (*PriorityQueue) Pop ¶
func (pq *PriorityQueue) Pop() interface{}
func (*PriorityQueue) Push ¶
func (pq *PriorityQueue) Push(x interface{})
func (PriorityQueue) Swap ¶
func (pq PriorityQueue) Swap(i, j int)
type RegistryType ¶
type RegistryType struct {
// contains filtered or unexported fields
}
func (*RegistryType) Register ¶
func (r *RegistryType) Register(day int, callee CalleeType)
Click to show internal directories.
Click to hide internal directories.