Documentation ¶
Index ¶
- Constants
- Variables
- func BinarySearchRank(key int, a []int) int
- func Draw() error
- func Gcd(p, q uint64) uint64
- func Random() float64
- func RandomUniform(min, max float64) float64
- func ReadInts(inbuf io.Reader) ([]int64, error)
- func ThreeSumCount(a []int64) int64
- type Accumulator
- type ArrayBag
- type ArrayBagCursor
- type ArrayQueue
- type ArrayQueueCursor
- type ArrayStack
- type ArrayStackCursor
- type Bag
- type Canvas
- type Counter
- type Date
- type In
- type Interval1D
- type Interval2D
- type Iterable
- type IterableCursor
- type LinkedListBag
- type LinkedListBagCursor
- type LinkedListQueue
- type LinkedListQueueCursor
- type LinkedListStack
- type LinkedListStackCursor
- type Node
- type Point2D
- type Queue
- type Stack
- type Stopwatch
Constants ¶
View Source
const ROLL_SIDES = 6
Variables ¶
Functions ¶
func BinarySearchRank ¶
func RandomUniform ¶
func ThreeSumCount ¶
Types ¶
type Accumulator ¶
type Accumulator struct {
// contains filtered or unexported fields
}
func NewAccumulator ¶
func NewAccumulator() *Accumulator
func (*Accumulator) AddDataValue ¶
func (me *Accumulator) AddDataValue(val float64)
func (*Accumulator) Mean ¶
func (me *Accumulator) Mean() float64
func (*Accumulator) String ¶
func (me *Accumulator) String() string
type ArrayBag ¶
type ArrayBag struct {
// contains filtered or unexported fields
}
func (*ArrayBag) First ¶
func (me *ArrayBag) First() IterableCursor
type ArrayBagCursor ¶
type ArrayBagCursor struct {
// contains filtered or unexported fields
}
func (*ArrayBagCursor) Next ¶
func (me *ArrayBagCursor) Next() IterableCursor
func (*ArrayBagCursor) Value ¶
func (me *ArrayBagCursor) Value() reflect.Value
type ArrayQueue ¶
type ArrayQueue struct {
// contains filtered or unexported fields
}
func (*ArrayQueue) Dequeue ¶
func (me *ArrayQueue) Dequeue() interface{}
func (*ArrayQueue) Enqueue ¶
func (me *ArrayQueue) Enqueue(item interface{})
func (*ArrayQueue) First ¶
func (me *ArrayQueue) First() IterableCursor
func (*ArrayQueue) IsEmpty ¶
func (me *ArrayQueue) IsEmpty() bool
func (*ArrayQueue) Size ¶
func (me *ArrayQueue) Size() int
type ArrayQueueCursor ¶
type ArrayQueueCursor struct {
// contains filtered or unexported fields
}
func (*ArrayQueueCursor) Next ¶
func (me *ArrayQueueCursor) Next() IterableCursor
func (*ArrayQueueCursor) Value ¶
func (me *ArrayQueueCursor) Value() reflect.Value
type ArrayStack ¶
type ArrayStack struct {
// contains filtered or unexported fields
}
func NewArrayStack ¶
func NewArrayStack() *ArrayStack
func (*ArrayStack) First ¶
func (me *ArrayStack) First() IterableCursor
func (*ArrayStack) IsEmpty ¶
func (me *ArrayStack) IsEmpty() bool
func (*ArrayStack) Pop ¶
func (me *ArrayStack) Pop() interface{}
func (*ArrayStack) Push ¶
func (me *ArrayStack) Push(item interface{})
func (*ArrayStack) Size ¶
func (me *ArrayStack) Size() int
type ArrayStackCursor ¶
type ArrayStackCursor struct {
// contains filtered or unexported fields
}
func (*ArrayStackCursor) Next ¶
func (me *ArrayStackCursor) Next() IterableCursor
func (*ArrayStackCursor) Value ¶
func (me *ArrayStackCursor) Value() reflect.Value
type Bag ¶
type Bag interface { Iterable Add(item interface{}) }
func NewArrayBag ¶
func NewArrayBag() Bag
func NewLinkedListBag ¶
func NewLinkedListBag() Bag
type Canvas ¶
type Interval1D ¶
func NewInterval1D ¶
func NewInterval1D(left, right float64) *Interval1D
func (*Interval1D) Contains ¶
func (me *Interval1D) Contains(x float64) bool
func (*Interval1D) Length ¶
func (me *Interval1D) Length() float64
type Interval2D ¶
type Interval2D struct { Xint *Interval1D Yint *Interval1D Canvas *Canvas }
func NewInterval2D ¶
func NewInterval2D(xint, yint *Interval1D, canvas *Canvas) *Interval2D
func (*Interval2D) Area ¶
func (me *Interval2D) Area() float64
func (*Interval2D) Contains ¶
func (me *Interval2D) Contains(p *Point2D) bool
func (*Interval2D) Draw ¶
func (me *Interval2D) Draw()
type Iterable ¶
type Iterable interface { First() IterableCursor IsEmpty() bool Size() int }
type IterableCursor ¶
type IterableCursor interface { Next() IterableCursor Value() reflect.Value }
type LinkedListBag ¶
type LinkedListBag struct {
// contains filtered or unexported fields
}
func (*LinkedListBag) Add ¶
func (me *LinkedListBag) Add(item interface{})
func (*LinkedListBag) First ¶
func (me *LinkedListBag) First() IterableCursor
func (*LinkedListBag) IsEmpty ¶
func (me *LinkedListBag) IsEmpty() bool
func (*LinkedListBag) Size ¶
func (me *LinkedListBag) Size() int
type LinkedListBagCursor ¶
type LinkedListBagCursor struct {
// contains filtered or unexported fields
}
func (*LinkedListBagCursor) Next ¶
func (me *LinkedListBagCursor) Next() IterableCursor
func (*LinkedListBagCursor) Value ¶
func (me *LinkedListBagCursor) Value() reflect.Value
type LinkedListQueue ¶
type LinkedListQueue struct {
// contains filtered or unexported fields
}
func (*LinkedListQueue) Dequeue ¶
func (me *LinkedListQueue) Dequeue() interface{}
func (*LinkedListQueue) Enqueue ¶
func (me *LinkedListQueue) Enqueue(item interface{})
func (*LinkedListQueue) First ¶
func (me *LinkedListQueue) First() IterableCursor
func (*LinkedListQueue) IsEmpty ¶
func (me *LinkedListQueue) IsEmpty() bool
func (*LinkedListQueue) Size ¶
func (me *LinkedListQueue) Size() int
type LinkedListQueueCursor ¶
type LinkedListQueueCursor struct {
// contains filtered or unexported fields
}
func (*LinkedListQueueCursor) Next ¶
func (me *LinkedListQueueCursor) Next() IterableCursor
func (*LinkedListQueueCursor) Value ¶
func (me *LinkedListQueueCursor) Value() reflect.Value
type LinkedListStack ¶
type LinkedListStack struct {
// contains filtered or unexported fields
}
func NewLinkedListStack ¶
func NewLinkedListStack() *LinkedListStack
func (*LinkedListStack) First ¶
func (me *LinkedListStack) First() IterableCursor
func (*LinkedListStack) IsEmpty ¶
func (me *LinkedListStack) IsEmpty() bool
func (*LinkedListStack) Pop ¶
func (me *LinkedListStack) Pop() interface{}
func (*LinkedListStack) Push ¶
func (me *LinkedListStack) Push(item interface{})
func (*LinkedListStack) Size ¶
func (me *LinkedListStack) Size() int
type LinkedListStackCursor ¶
type LinkedListStackCursor struct {
// contains filtered or unexported fields
}
func (*LinkedListStackCursor) Next ¶
func (me *LinkedListStackCursor) Next() IterableCursor
func (*LinkedListStackCursor) Value ¶
func (me *LinkedListStackCursor) Value() reflect.Value
type Point2D ¶
func NewPoint2D ¶
type Queue ¶
type Queue interface { Iterable Enqueue(item interface{}) Dequeue() interface{} }
func NewArrayQueue ¶
func NewArrayQueue() Queue
func NewLinkedListQueue ¶
func NewLinkedListQueue() Queue
type Stopwatch ¶
type Stopwatch struct {
// contains filtered or unexported fields
}
func NewStopwatch ¶
func NewStopwatch() *Stopwatch
func (*Stopwatch) ElapsedTime ¶
Source Files ¶
- accumulator.go
- array_bag.go
- array_queue.go
- array_stack.go
- bag.go
- binarysearch.go
- canvas.go
- counter.go
- date.go
- draw.go
- gcd.go
- interval1d.go
- interval2d.go
- io.go
- iterable.go
- linked_list_bag.go
- linked_list_queue.go
- linked_list_stack.go
- node.go
- point2d.go
- queue.go
- random.go
- rolls.go
- stack.go
- stopwatch.go
- threesum.go
Click to show internal directories.
Click to hide internal directories.