List es una librería para gestionar una Lista enlazada.
Objeto List
- tipo
LinkedList
, con métodos: Add(...Item)
Index(Item) int
Slice() []interface{}
IsEmpty() bool
Len() int
String() string
Insert(int, Item) error
Remove()
RemoveAt(int)(*Item,error)
Contains(Item) bool
Funciones
NewList(...Item)
Eventos
Init(*List) error {}
in NewListInsert(*List, *Node) error {}
in InsertGet(*List, *Node) error {}
in GetRemove(*List, *Node) error {}
in RemovePop(*List, *Node) error {}
in PopMove(*List, int) error {}
in MoveTo
list := NewList()
flaga := list.Empty()
list.Push("solo", "han", 16, "norris")
node := list.Head.next // obtiene iterador
flaga = list.Empty()
fore := list.Slice()
list.Push("jesus")
list.Push(25)
list.Push("torres")
list.Push("sacristan")
foreA := list.Slice()[2]
flag := list.Contains("jesus")
nb := list.Length()
list.Insert(0, "gilipollas")
list.Insert(1, "probaperas")
list.Insert(4, "tocomocho")
fore = list.Slice()
negre, _ := list.Pop(2)
fore = list.Slice()
negre, _ = list.Pop(0)
fore = list.Slice()
negre, _ = list.Pop(6)
fore = list.Slice()
list.Push("jesus")
list.Push("torres")
list.Push("sacristan")
fore = list.Slice()
nb = list.Length()
list.Remove()
fmt.Println(flag, flaga, fore, foreA, negre, nb, node)