Documentation ¶
Index ¶
- Variables
- func TestALG_Append(t *testing.T)
- func TestALG_Clear(t *testing.T)
- func TestALG_Find(t *testing.T)
- func TestALG_Insert(t *testing.T)
- func TestALG_Next(t *testing.T)
- func TestALG_Prev(t *testing.T)
- func TestALG_Remove(t *testing.T)
- func TestALG_Vacia(t *testing.T)
- type ArrayList
- func (lista *ArrayList) Append(valor int) (err error)
- func (lista *ArrayList) Clear()
- func (lista ArrayList) CurrentElement() (valor int, err error)
- func (lista *ArrayList) Find(valor int) int
- func (lista *ArrayList) Insert(valor int) (err error)
- func (lista ArrayList) Length() int
- func (lista *ArrayList) MoveToEnd()
- func (lista *ArrayList) MoveToPos(pos int) (err error)
- func (lista *ArrayList) MoveToStart()
- func (lista *ArrayList) Next()
- func (lista *ArrayList) Prev()
- func (lista *ArrayList) Remove() (valor int, err error)
- func (lista ArrayList) String() string
- type ArrayListGeneric
- func (lista *ArrayListGeneric[T]) Append(valor T) (err error)
- func (lista *ArrayListGeneric[T]) Clear()
- func (lista ArrayListGeneric[T]) CurrentElement() (valor T, err error)
- func (lista *ArrayListGeneric[T]) Find(valor T) int
- func (lista *ArrayListGeneric[T]) Insert(valor T) (err error)
- func (lista ArrayListGeneric[T]) Length() int
- func (lista *ArrayListGeneric[T]) MoveToEnd()
- func (lista *ArrayListGeneric[T]) MoveToPos(pos int) (err error)
- func (lista *ArrayListGeneric[T]) MoveToStart()
- func (lista *ArrayListGeneric[T]) Next()
- func (lista *ArrayListGeneric[T]) Prev()
- func (lista *ArrayListGeneric[T]) Remove() (valor T, err error)
- func (lista ArrayListGeneric[T]) String() string
- type LinkedList
- func (lista *LinkedList) Append(e int) (node *Node)
- func (lista *LinkedList) Clear()
- func (lista LinkedList) CurrentElement() (e int, err error)
- func (lista LinkedList) CurrentPosition() int
- func (lista *LinkedList) Insert(e int) (node *Node)
- func (lista LinkedList) Length() int
- func (lista *LinkedList) MoveToEnd()
- func (lista *LinkedList) MoveToPos(pos int) (err error)
- func (lista *LinkedList) MoveToStart()
- func (lista *LinkedList) Next()
- func (lista *LinkedList) Prev()
- func (lista *LinkedList) Remove() (node *Node, err error)
- type List
- type Node
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrEmptyList = errors.New("lista vacia")
Errores comunes en las listas
View Source
var ErrFullList = errors.New("lista llena")
View Source
var ErrOutOfRangeList = errors.New("fuera de rango")
Functions ¶
func TestALG_Append ¶
func TestALG_Clear ¶
func TestALG_Find ¶
func TestALG_Insert ¶
func TestALG_Next ¶
func TestALG_Prev ¶
func TestALG_Remove ¶
func TestALG_Vacia ¶
Types ¶
type ArrayList ¶
type ArrayList struct {
// contains filtered or unexported fields
}
func (ArrayList) CurrentElement ¶
func (*ArrayList) MoveToStart ¶
func (lista *ArrayList) MoveToStart()
type ArrayListGeneric ¶
type ArrayListGeneric[T comparable] struct { // contains filtered or unexported fields }
func NewArrayListGeneric ¶
func NewArrayListGeneric[T comparable](capacidad int) *ArrayListGeneric[T]
constructor
func (*ArrayListGeneric[T]) Append ¶
func (lista *ArrayListGeneric[T]) Append(valor T) (err error)
func (*ArrayListGeneric[T]) Clear ¶
func (lista *ArrayListGeneric[T]) Clear()
func (ArrayListGeneric[T]) CurrentElement ¶
func (lista ArrayListGeneric[T]) CurrentElement() (valor T, err error)
func (*ArrayListGeneric[T]) Find ¶
func (lista *ArrayListGeneric[T]) Find(valor T) int
func (*ArrayListGeneric[T]) Insert ¶
func (lista *ArrayListGeneric[T]) Insert(valor T) (err error)
func (*ArrayListGeneric[T]) MoveToEnd ¶
func (lista *ArrayListGeneric[T]) MoveToEnd()
func (*ArrayListGeneric[T]) MoveToPos ¶
func (lista *ArrayListGeneric[T]) MoveToPos(pos int) (err error)
func (*ArrayListGeneric[T]) MoveToStart ¶
func (lista *ArrayListGeneric[T]) MoveToStart()
func (*ArrayListGeneric[T]) Next ¶
func (lista *ArrayListGeneric[T]) Next()
func (*ArrayListGeneric[T]) Prev ¶
func (lista *ArrayListGeneric[T]) Prev()
func (*ArrayListGeneric[T]) Remove ¶
func (lista *ArrayListGeneric[T]) Remove() (valor T, err error)
func (ArrayListGeneric[T]) String ¶
func (lista ArrayListGeneric[T]) String() string
type LinkedList ¶
type LinkedList struct {
// contains filtered or unexported fields
}
func (*LinkedList) Append ¶
func (lista *LinkedList) Append(e int) (node *Node)
Agrega un nodo al final de la lista (tail)
func (LinkedList) CurrentElement ¶
func (lista LinkedList) CurrentElement() (e int, err error)
func (LinkedList) CurrentPosition ¶
func (lista LinkedList) CurrentPosition() int
func (*LinkedList) Insert ¶
func (lista *LinkedList) Insert(e int) (node *Node)
Agrega un nodo desplazando al nodo actual (curr)
func (LinkedList) Length ¶
func (lista LinkedList) Length() int
func (*LinkedList) MoveToPos ¶
func (lista *LinkedList) MoveToPos(pos int) (err error)
Mueve [curr] una cantidad de nodos (pos) a partir de head
func (*LinkedList) MoveToStart ¶
func (lista *LinkedList) MoveToStart()
Coloca al [curr] en el nodo head
func (*LinkedList) Remove ¶
func (lista *LinkedList) Remove() (node *Node, err error)
Remueve el nodo actual (curr)
type List ¶
type List interface { Clear() // O(1) Length() // O(1) Append(e int) // O(1) *Agrega al tail.. Insert(e int) // O(n) Remove() // O(n) MoveToStart() // O(1) MoveToEnd() // O(1) MoveToPos(pos int) // Array: O(1) LinkedList: O(n) Prev() // Array: O(1) LinkedList: O(n) Next() // O(1) CurrentPosition() // Array: O(1) LinkedList: O(n) CurrentElement() // O(1) }
Click to show internal directories.
Click to hide internal directories.