data-structures: github.com/timtadh/data-structures/linked Index | Files

package linked

import "github.com/timtadh/data-structures/linked"

Index

Package Files

linked.go unique.go

type LinkedList Uses

type LinkedList struct {
    Length int
    Head   *Node
    Tail   *Node
}

A doubly linked list. There is no synchronization. The fields are publically accessible to allow for easy customization.

func New Uses

func New() *LinkedList

func (*LinkedList) Backwards Uses

func (l *LinkedList) Backwards() (it types.KIterator)

func (*LinkedList) DequeBack Uses

func (l *LinkedList) DequeBack() (item types.Hashable, err error)

func (*LinkedList) DequeFront Uses

func (l *LinkedList) DequeFront() (item types.Hashable, err error)

func (*LinkedList) EnqueBack Uses

func (l *LinkedList) EnqueBack(item types.Hashable) (err error)

func (*LinkedList) EnqueFront Uses

func (l *LinkedList) EnqueFront(item types.Hashable) (err error)

func (*LinkedList) Equals Uses

func (l *LinkedList) Equals(b types.Equatable) bool

Can be compared to any types.IterableContainer

func (*LinkedList) First Uses

func (l *LinkedList) First() (item types.Hashable)

func (*LinkedList) Has Uses

func (l *LinkedList) Has(item types.Hashable) bool

func (*LinkedList) Hash Uses

func (l *LinkedList) Hash() int

func (*LinkedList) Items Uses

func (l *LinkedList) Items() (it types.KIterator)

func (*LinkedList) Last Uses

func (l *LinkedList) Last() (item types.Hashable)

func (*LinkedList) Less Uses

func (l *LinkedList) Less(b types.Sortable) bool

Can be compared to any types.IterableContainer

func (*LinkedList) Pop Uses

func (l *LinkedList) Pop() (item types.Hashable, err error)

func (*LinkedList) Push Uses

func (l *LinkedList) Push(item types.Hashable) (err error)

func (*LinkedList) Size Uses

func (l *LinkedList) Size() int

func (*LinkedList) String Uses

func (l *LinkedList) String() string

type Node Uses

type Node struct {
    Data       types.Hashable
    Next, Prev *Node
}

A doubly linked list node.

func (*Node) Equals Uses

func (n *Node) Equals(b types.Equatable) bool

Compares the Data of the node to the passed element.

func (*Node) Hash Uses

func (n *Node) Hash() int

Hashes the Data of the node to the passed element.

func (*Node) Less Uses

func (n *Node) Less(b types.Sortable) bool

Compares the Data of the node to the passed element.

type UniqueDeque Uses

type UniqueDeque struct {
    // contains filtered or unexported fields
}

func NewUniqueDeque Uses

func NewUniqueDeque() *UniqueDeque

A double ended queue that only allows unique items inside. Constructed from a doubly linked list and a linear hash table.

func (*UniqueDeque) Backwards Uses

func (l *UniqueDeque) Backwards() (it types.KIterator)

func (*UniqueDeque) DequeBack Uses

func (l *UniqueDeque) DequeBack() (item types.Hashable, err error)

func (*UniqueDeque) DequeFront Uses

func (l *UniqueDeque) DequeFront() (item types.Hashable, err error)

func (*UniqueDeque) EnqueBack Uses

func (l *UniqueDeque) EnqueBack(item types.Hashable) (err error)

func (*UniqueDeque) EnqueFront Uses

func (l *UniqueDeque) EnqueFront(item types.Hashable) (err error)

func (*UniqueDeque) Equals Uses

func (l *UniqueDeque) Equals(b types.Equatable) bool

Can be compared to any types.IterableContainer

func (*UniqueDeque) First Uses

func (l *UniqueDeque) First() (item types.Hashable)

func (*UniqueDeque) Has Uses

func (l *UniqueDeque) Has(item types.Hashable) bool

func (*UniqueDeque) Hash Uses

func (l *UniqueDeque) Hash() int

func (*UniqueDeque) Items Uses

func (l *UniqueDeque) Items() (it types.KIterator)

func (*UniqueDeque) Last Uses

func (l *UniqueDeque) Last() (item types.Hashable)

func (*UniqueDeque) Less Uses

func (l *UniqueDeque) Less(b types.Sortable) bool

Can be compared to any types.IterableContainer

func (*UniqueDeque) Pop Uses

func (l *UniqueDeque) Pop() (item types.Hashable, err error)

func (*UniqueDeque) Push Uses

func (l *UniqueDeque) Push(item types.Hashable) (err error)

func (*UniqueDeque) Size Uses

func (l *UniqueDeque) Size() int

func (*UniqueDeque) String Uses

func (l *UniqueDeque) String() string

Package linked imports 7 packages (graph). Updated 2016-07-19. Refresh now. Tools for package owners.