Containers
All data structures implement the container interface with the following methods:
type Container interface {
Empty() bool
Size() int
Clear()
Values() []interface{}
}
Containers are either ordered or unordered. All ordered containers provide stateful iterators and some of them allow enumerable functions.
Data | Structure | Ordered | Iterator | Enumerable | Referenced by |
---|---|---|---|---|---|
Lists | |||||
ArrayList | yes | yes* | yes | index | |
SinglyLinkedList | yes | yes | yes | index | |
DoublyLinkedList | yes | yes* | yes | index | |
Sets | |||||
HashSet | no | no | no | index | |
TreeSet | yes | yes* | yes | index | |
LinkedHashSet | yes | yes* | yes | index | |
Stacks | |||||
LinkedListStack | yes | yes | no | index | |
ArrayStack | yes | yes* | no | index | |
Maps | |||||
HashMap | no | no | no | key | |
TreeMap | yes | yes* | yes | key | |
LinkedHashMap | yes | yes* | yes | key | |
HashBidiMap | no | no | no | key* | |
TreeBidiMap | yes | yes* | yes | key* | |
Trees | |||||
RedBlackTree | yes | yes* | no | key | |
AVLTree | yes | yes* | no | key | |
BTree | yes | yes* | no | key | |
BinaryHeap | yes | yes* | no | index | |
*reversible | *bidirectional |