Documentation ¶
Index ¶
- type Counter
- type Deque
- func (dq *Deque) Append(v interface{})
- func (dq *Deque) AppendLeft(v interface{})
- func (dq *Deque) Clear()
- func (dq *Deque) Extend(other *list.List)
- func (dq *Deque) ExtendLeft(other *list.List)
- func (dq *Deque) Index(v interface{}, start int, end int) (position int, find bool)
- func (dq *Deque) Pop() (v interface{}, canPop bool)
- func (dq *Deque) PopLeft() (v interface{}, canGet bool)
- func (dq *Deque) Remove(v interface{}) (removed bool)
- func (dq *Deque) Rotate(step int)
- func (dq *Deque) Size() int
- type LinkedList
- type LinkedNode
- type OrderedMap
- type Pair
- type PairList
- type Queue
- type Set
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Counter ¶
type Counter struct { Count map[interface{}]int // contains filtered or unexported fields }
func NewCounter ¶
func NewCounter(elems ...interface{}) (c *Counter)
func (*Counter) Add ¶
func (c *Counter) Add(elem interface{})
add a elem(key) into the counter and incr the counts of the key
func (*Counter) Elements ¶
func (c *Counter) Elements() []interface{}
return elements of the counter
func (*Counter) MostCommon ¶
return top frequently keys and their counts
type Deque ¶
type Deque struct {
// contains filtered or unexported fields
}
func (*Deque) ExtendLeft ¶
ExtendLeft push front a container/list
func (*Deque) Index ¶
Index return the first index between start(include) and end(not include) which match v, find will be false if can not find
type LinkedList ¶
type LinkedList struct {
// contains filtered or unexported fields
}
func NewLinkdList ¶
func NewLinkdList() *LinkedList
func (*LinkedList) Append ¶
func (l *LinkedList) Append(key interface{}, value interface{}) *LinkedNode
func (*LinkedList) Iter ¶
func (l *LinkedList) Iter() chan *LinkedNode
func (*LinkedList) Remove ¶
func (l *LinkedList) Remove(n *LinkedNode) bool
type LinkedNode ¶
type LinkedNode struct {
// contains filtered or unexported fields
}
type OrderedMap ¶
type OrderedMap struct {
// contains filtered or unexported fields
}
func NewOrderedMap ¶
func NewOrderedMap() *OrderedMap
func (*OrderedMap) Del ¶
func (om *OrderedMap) Del(key interface{}) bool
Del del a key from ordered map, return false if key not exist
func (*OrderedMap) Set ¶
func (om *OrderedMap) Set(key interface{}, value interface{}, putEndIfExists bool)
Set set k-v and push back the k-v, the order will not change if the key already exist unless putEndIfExists is true
type Pair ¶
type Pair struct { Key interface{} // key add to counter Value int // store counts of the key }
Source Files ¶
Click to show internal directories.
Click to hide internal directories.