gods: github.com/emirpasic/gods/lists Index | Files | Directories

package lists

import "github.com/emirpasic/gods/lists"

Package lists provides an abstract List interface.

In computer science, a list or sequence is an abstract data type that represents an ordered sequence of values, where the same value may occur more than once. An instance of a list is a computer representation of the mathematical concept of a finite sequence; the (potentially) infinite analog of a list is a stream. Lists are a basic example of containers, as they contain other values. If the same value occurs multiple times, each occurrence is considered a distinct item.

Reference: https://en.wikipedia.org/wiki/List_%28abstract_data_type%29


Package Files


type List Uses

type List interface {
    Get(index int) (interface{}, bool)
    Remove(index int)
    Add(values ...interface{})
    Contains(values ...interface{}) bool
    Sort(comparator utils.Comparator)
    Swap(index1, index2 int)
    Insert(index int, values ...interface{})
    Set(index int, value interface{})


List interface that all lists implement


arraylistPackage arraylist implements the array list.
doublylinkedlistPackage doublylinkedlist implements the doubly-linked list.
singlylinkedlistPackage singlylinkedlist implements the singly-linked list.

Package lists imports 2 packages (graph) and is imported by 30 packages. Updated 2018-09-21. Refresh now. Tools for package owners.