IList - acadet/ludivine GitHub Wiki

IList<T>
|> IListableCollection<T>
    |> ISortableCollection<T>
        |> ICollection<T>

Interface for simple lists. T types elements.

Current implementations

References

insertAt(index : number, value : T) : void

Inserts value at specified index.

Parameters

index Index

value Value

Implementation performances

Choosing a list implementation may alter your performances. Here is a sum up of what implementation you should choose to fit your needs (time/space complexity).

| ArrayList | LinkedList --- | --- | --- add | Θ(1) / Θ(1) | Θ(1) / Θ(1) average | Θ(n) / Θ(1) | Θ(n) / Θ(1) exists | O(n) / Θ(1) | O(n) / Θ(1) find | O(n) / Θ(1) | O(n) / Θ(1) forEach | Θ(n) / Θ(1) | Θ(n) / Θ(1) getAt | :star: Θ(1) / Θ(1) | O(n) / Θ(1) getLength | Θ(1) / Θ(1) | Θ(1) / Θ(1) insertAt | Θ(n) / Θ(1) | :star: O(n) / Θ(1) intersect | Θ(n) / Θ(n) | Θ(n) / Θ(n) map | Θ(n) / Θ(n) | Θ(n) / Θ(n) max | Θ(n) / Θ(1) | Θ(n) / Θ(1) min | Θ(n) / Θ(1) | Θ(n) / Θ(1) orderBy | Θ(nlog (n)) / Θ(n) | Θ(nlog (n)) / Θ(n) orderByDesc | Θ(nlog (n)) / Θ(n) | Θ(nlog (n)) / Θ(n) remove | Θ(n) / Θ(n) | :star: O(n) / Θ(1) removeAt | Θ(n) / Θ(n) | :star: O(n) / Θ(1) removeIf | Θ(n) / Θ(n) | :star: O(n) / Θ(1) reverse | :star: Θ(n) / Θ(n) | Θ(n) / Θ(n) select | Θ(n) / O(n) | Θ(n) / O(n) sum | Θ(n) / Θ(1) | Θ(n) / Θ(1) toArray | Θ(n) / Θ(n) | Θ(n) / Θ(n) toDictionary | Θ(n) / Θ(n) | Θ(n) / Θ(n) toList | Θ(n) / Θ(n) | Θ(n) / Θ(n) union | Θ(n) / Θ(n) | Θ(n) / Θ(n) uniq | Θ(n) / Θ(n) | Θ(n) / Θ(n)

NB: LinkedList may guzzler more space than a classic ArrayList.