Constructors

Link copied to clipboard
constructor()

Properties

Link copied to clipboard
open override var size: Int

Functions

Link copied to clipboard
open override fun add(element: T): Boolean
Link copied to clipboard
open override fun addAll(elements: Collection<T>): Boolean
Link copied to clipboard
fun append(value: T)

Adds an element to the end of the list a.k.a the tail Time complexity O(1)

Link copied to clipboard
open override fun clear()
Link copied to clipboard
open operator override fun contains(element: T): Boolean

Checks whether the element is in the list Time complexity O(n)

Link copied to clipboard
open override fun containsAll(elements: Collection<T>): Boolean

Checks whether the elements are present into the list Time complexity O(n^2)

Link copied to clipboard
open fun forEach(p0: Consumer<in T>)
Link copied to clipboard
Link copied to clipboard
fun insert(value: T, afterNode: Node<T>): Node<T>

Insert a value after a node Time complexity O(1)

Link copied to clipboard
open override fun isEmpty(): Boolean
Link copied to clipboard

Checks whether the list is not empty

Link copied to clipboard
open operator override fun iterator(): MutableIterator<T>
Link copied to clipboard
Link copied to clipboard
fun nodeAt(index: Int): Node<T>?

Find a node at specific index Time complexity O(index) where index is the parameter

Link copied to clipboard
open fun parallelStream(): Stream<T>
Link copied to clipboard
fun pop(): T?

Removes a value at the front of the list

Link copied to clipboard
Link copied to clipboard
fun push(value: T): LinkedList<T>

Adds an element to the first position in the list a.k.a the head Time complexity O(1)

Link copied to clipboard
open override fun remove(element: T): Boolean
Link copied to clipboard
fun removeAfter(node: Node<T>): T?

Remove element after a node (remove the immediate next node). Time complexity O(1)

Link copied to clipboard
open override fun removeAll(elements: Collection<T>): Boolean
Link copied to clipboard
open fun removeIf(p0: Predicate<in T>): Boolean
Link copied to clipboard
fun removeLast(): T?

Remove the last element of the list Time complexity O(n)

Link copied to clipboard
open override fun retainAll(elements: Collection<T>): Boolean
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
open fun stream(): Stream<T>
Link copied to clipboard
open fun <T : Any> toArray(p0: IntFunction<Array<T>>): Array<T>
Link copied to clipboard
open override fun toString(): String