Documentation ¶
Overview ¶
Package linkedlist creates a ItemLinkedList data structure for the Item type
Index ¶
- type Item
- type ItemLinkedList
- func (ll *ItemLinkedList) Append(t Item)
- func (ll *ItemLinkedList) Head() *Node
- func (ll *ItemLinkedList) IndexOf(t Item) int
- func (ll *ItemLinkedList) Insert(i int, t Item) error
- func (ll *ItemLinkedList) IsEmpty() bool
- func (ll *ItemLinkedList) RemoveAt(i int) (*Item, error)
- func (ll *ItemLinkedList) Size() int
- func (ll *ItemLinkedList) String()
- type Node
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ItemLinkedList ¶
type ItemLinkedList struct {
// contains filtered or unexported fields
}
ItemLinkedList the linked list of Items
func (*ItemLinkedList) Append ¶
func (ll *ItemLinkedList) Append(t Item)
Append adds an Item to the end of the linked list
func (*ItemLinkedList) Head ¶
func (ll *ItemLinkedList) Head() *Node
Head returns a pointer to the first node of the list
func (*ItemLinkedList) IndexOf ¶
func (ll *ItemLinkedList) IndexOf(t Item) int
IndexOf returns the position of the Item t
func (*ItemLinkedList) Insert ¶
func (ll *ItemLinkedList) Insert(i int, t Item) error
Insert adds an Item at position i
func (*ItemLinkedList) IsEmpty ¶
func (ll *ItemLinkedList) IsEmpty() bool
IsEmpty returns true if the list is empty
func (*ItemLinkedList) RemoveAt ¶
func (ll *ItemLinkedList) RemoveAt(i int) (*Item, error)
RemoveAt removes a node at position i
func (*ItemLinkedList) Size ¶
func (ll *ItemLinkedList) Size() int
Size returns the linked list size
func (*ItemLinkedList) String ¶
func (ll *ItemLinkedList) String()
Insert adds an Item at position i
Click to show internal directories.
Click to hide internal directories.