Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type FloatArray ¶
type FloatArray struct {
// contains filtered or unexported fields
}
FloatArray represents a float array, support mark pos if has value
func NewFloatArray ¶
func NewFloatArray(capacity int) *FloatArray
NewFloatArray creates a float array
func (*FloatArray) GetValue ¶
func (f *FloatArray) GetValue(pos int) float64
GetValue returns value with pos, if has not value return 0
func (*FloatArray) HasValue ¶
func (f *FloatArray) HasValue(pos int) bool
HasValue returns if has value with pos
func (*FloatArray) Iterator ¶
func (f *FloatArray) Iterator() *FloatArrayIterator
Iterator returns an iterator over the array
func (*FloatArray) SetValue ¶
func (f *FloatArray) SetValue(pos int, value float64)
SetValue sets value with pos, if pos out of bounds, return it
type FloatArrayIterator ¶
type FloatArrayIterator struct {
// contains filtered or unexported fields
}
FloatArrayIterator represents a float array iterator
func (*FloatArrayIterator) HasNext ¶
func (it *FloatArrayIterator) HasNext() bool
HasNext returns if this iterator has more values
func (*FloatArrayIterator) Next ¶
func (it *FloatArrayIterator) Next() (idx int, value float64)
Next returns the next value and index
type Stack ¶
type Stack struct {
// contains filtered or unexported fields
}
Stack represents a last-in-first-out(LIFO) stack of interface, using slice saving data. NOTICE: not safe for goroutine concurrent
func (*Stack) Peek ¶
func (s *Stack) Peek() interface{}
Peek looks at the element at the top of this stack without removing it from the stack
func (*Stack) Pop ¶
func (s *Stack) Pop() interface{}
Pop removes the element at the top of this stack, if stack is empty return nil