Documentation ¶
Overview ¶
In progress
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BFSPath ¶
func NewBFSPath ¶
type BinaryHeap ¶
type BinaryHeap struct {
// contains filtered or unexported fields
}
func NewBinaryHeap ¶
func NewBinaryHeap(capacity int) *BinaryHeap
func (*BinaryHeap) Add ¶
func (b *BinaryHeap) Add(node int)
Add add node at the end, them swim it up At most 1 + lgN compares
func (*BinaryHeap) DeleteMax ¶
func (b *BinaryHeap) DeleteMax()
DeleteMax exchanges root with node at end, them sink it down At most 2lnN compares
func (*BinaryHeap) Empty ¶
func (b *BinaryHeap) Empty() bool
func (*BinaryHeap) Print ¶
func (b *BinaryHeap) Print()
type ConnectedComponent ¶
type ConnectedComponent struct {
// contains filtered or unexported fields
}
A connected component is a maximal set of connected vertices.
func NewConnectedComponent ¶
func NewConnectedComponent(g *Graph) *ConnectedComponent
NewConnectedComponent preprocess the graph to find connected components in G
func (*ConnectedComponent) Connected ¶
func (c *ConnectedComponent) Connected(v, w int) bool
Connected returns if v an w are connected.
func (*ConnectedComponent) Count ¶
func (c *ConnectedComponent) Count() int
Count returns the number of connected components
func (*ConnectedComponent) Display ¶
func (c *ConnectedComponent) Display()
func (*ConnectedComponent) GetID ¶
func (c *ConnectedComponent) GetID(v int) int
getID returns the componenent identifier for v
type DFSPath ¶
func NewDFSPath ¶
type Graph ¶
func (*Graph) NbVertices ¶
NbVertices returns the nunber of vertices
func (*Graph) NumberOfSelfLoops ¶
NumberOfSelfLoops returns the number of Self loops
type Hash ¶
func NewHashLinearProbing ¶
func NewHashLinearProbing() Hash
func NewHashSeperateChaining ¶
func NewHashSeperateChaining() Hash
type Queue ¶
type Queue interface { Enqueue(obj interface{}) Dequeue() interface{} IsEmpty() bool Size() int Iterate() <-chan interface{} }
func NewQueueLinkedList ¶
func NewQueueLinkedList() Queue
type SimpleIterator ¶
type SimpleIterator struct { Length int // contains filtered or unexported fields }
SimpleIterator is a simple struct to illustrate an implementation of an iterator
func NewSimpleIterator ¶
func NewSimpleIterator() *SimpleIterator
NewSimpleIterator initialize a new SimpleIterator
func (*SimpleIterator) Names ¶
func (s *SimpleIterator) Names() <-chan string
Names return an Iterator by using a chanel
type Stack ¶
type Stack interface { Push(item interface{}) Pop() interface{} IsEmpty() bool Size() int Iterate() <-chan interface{} }
func NewStackArray ¶
func NewStackArray() Stack
func NewStackLinkedList ¶
func NewStackLinkedList() Stack
type Tree ¶
type Tree struct {
// contains filtered or unexported fields
}
A Tree is a simple binaray tree
func (*Tree) DisplayBFS ¶
func (t *Tree) DisplayBFS()
type Trie_Ternary ¶
type Trie_Ternary struct {
Root *TTNode
}
func (*Trie_Ternary) Get ¶
func (t *Trie_Ternary) Get(key string) interface{}
func (*Trie_Ternary) Put ¶
func (t *Trie_Ternary) Put(key string, val interface{})