Documentation ¶
Overview ¶
Package containers contains implementations of several containers.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Array ¶
type Array interface { // Return element at specified position At(uint) *interface{} // Set the size SetSize(uint) // Return size (number of elements) Size() uint }
func NewDynamicArray ¶
NewDynamicArray() returns a containers.DynamicArray implementation of the containers.Array interface.
type ArrayStack ¶
type DynamicArray ¶
type DynamicArray struct {
// contains filtered or unexported fields
}
DynamicArray implements the containers.Array interface. Resizing a DynamicArray does not involve copying. DynamicArray is also a sparse array. Portions of the array are allocated chunks of the "clusterSize" parameter passed to the constructor. The larger the cluster size, the faster the access. Currently, shrinking is not very efficient for large cluster sizes; therefore, PopBack() also is not very efficient.
func (*DynamicArray) At ¶
func (da *DynamicArray) At(i uint) *interface{}
func (*DynamicArray) SetSize ¶
func (da *DynamicArray) SetSize(newSize uint)
func (*DynamicArray) Size ¶
func (da *DynamicArray) Size() uint
type Stack ¶
type Stack interface { PushBack(v interface{}) PushFront(v interface{}) PopBack() interface{} PopFront() interface{} }
type StackArrayDecorator ¶
type StackArrayDecorator struct {
Array
}
func (StackArrayDecorator) PopBack ¶
func (sad StackArrayDecorator) PopBack() interface{}
func (StackArrayDecorator) PopFront ¶
func (sad StackArrayDecorator) PopFront() interface{}
func (StackArrayDecorator) PushBack ¶
func (sad StackArrayDecorator) PushBack(v interface{})
func (StackArrayDecorator) PushFront ¶
func (sad StackArrayDecorator) PushFront(v interface{})
Click to show internal directories.
Click to hide internal directories.