Project to keep track of my learnings and experiments while learning the Go programming language and reviewing the common Abstract Data Types (ADT), data structures, and algorithms.
$ go get github.com/kevinpollet/go-datastructures
type List interface {
Add(value interface{})
Clear()
Get(index int) (interface{}, error)
IndexOf(value interface{}) int
Insert(index int, value interface{}) error
IsEmpty() bool
Remove(index int) (interface{}, error)
Size() int
}
type Stack interface {
Clear()
IsEmpty() bool
Peek() (interface{}, error)
Pop() (interface{}, error)
Push(value interface{})
Size() int
}
type Queue interface {
Clear()
IsEmpty() bool
Offer(value interface{})
Peek() (interface{}, error)
Poll() (interface{}, error)
Size() int
}
type Dequeue interface {
Clear()
IsEmpty() bool
OfferFirst(value interface{})
OfferLast(value interface{})
PeekFirst() (interface{}, error)
PeekLast() (interface{}, error)
PollFirst() (interface{}, error)
PollLast() (interface{}, error)
Size() int
}
type PriorityQueue interface {
Clear()
IsEmpty() bool
Offer(value interface{}, priority int)
Peek() (interface{}, error)
Poll() (interface{}, error)
Size() int
}