dequeOf

expect fun <T> dequeOf(vararg items: T): MutableList<T>

Creates a new, mutable double-ended queue (deque) containing the given items, in order.

The result is exposed as a plain MutableList for API convenience (e.g. random access), but each platform backs it with a data structure efficient at both ends (e.g. java.util.LinkedList on the JVM), so that addFirst and takeFirst are cheap; use it wherever elements are pushed/popped from the front as well as the back, such as the traversal fringe of it.unibo.tuprolog.utils.graphs.AbstractSearchStrategy.


expect fun <T> dequeOf(items: Iterable<T>): MutableList<T>
expect fun <T> dequeOf(items: Sequence<T>): MutableList<T>

Creates a new, mutable dequeOf deque containing the elements of items, in iteration order.

actual fun <T> dequeOf(vararg items: T): MutableList<T>

Creates a new, mutable double-ended queue (deque) containing the given items, in order.

The result is exposed as a plain MutableList for API convenience (e.g. random access), but each platform backs it with a data structure efficient at both ends (e.g. java.util.LinkedList on the JVM), so that addFirst and takeFirst are cheap; use it wherever elements are pushed/popped from the front as well as the back, such as the traversal fringe of it.unibo.tuprolog.utils.graphs.AbstractSearchStrategy.


actual fun <T> dequeOf(items: Iterable<T>): MutableList<T>
actual fun <T> dequeOf(items: Sequence<T>): MutableList<T>

Creates a new, mutable dequeOf deque containing the elements of items, in iteration order.

actual fun <T> dequeOf(vararg items: T): MutableList<T>

Creates a new, mutable double-ended queue (deque) containing the given items, in order.

The result is exposed as a plain MutableList for API convenience (e.g. random access), but each platform backs it with a data structure efficient at both ends (e.g. java.util.LinkedList on the JVM), so that addFirst and takeFirst are cheap; use it wherever elements are pushed/popped from the front as well as the back, such as the traversal fringe of it.unibo.tuprolog.utils.graphs.AbstractSearchStrategy.


actual fun <T> dequeOf(items: Iterable<T>): MutableList<T>
actual fun <T> dequeOf(items: Sequence<T>): MutableList<T>

Creates a new, mutable dequeOf deque containing the elements of items, in iteration order.