Import std.collections.deque
Deque
class
@DebugElements Public Class Deque<T> Implements Iterable<T>, Cloneable, Defaultable
A double-ended queue: values go on and come off at either end.
Examples
Local deque = Deque<Int>()
deque.AddLast(2)
deque.AddFirst(1)
deque.AddLast(3)
Expect(deque.RemoveFirst() == 1)
Expect(deque.RemoveLast() == 3)
Expect(deque.ToArray() == [2])std/collections/deque.fb, line 22
-
How many values it holds.
-
Puts
valueat the front. A Deque holds at most 2147483647 values, as many as its Int Count counts, as an array does, and one more panics. -
Puts
valueat the back. A Deque holds at most 2147483647 values, as many as its Int Count counts, as an array does, and one more panics. -
The same as AddLast.
-
Adds each of the
valueslast, in order. -
Takes the first value off and gives it. Panics when the Deque is empty.
-
Takes the last value off and gives it. Panics when the Deque is empty.
-
The first value, which stays, as everything else does. Panics when the Deque is empty.
-
The last value, which stays, as everything else does. Panics when the Deque is empty.
-
Takes the first value off and gives it, or Null when the Deque is empty.
-
Takes the last value off and gives it, or Null when the Deque is empty.
-
The first value, which stays, or Null when the Deque is empty.
-
The last value, which stays, or Null when the Deque is empty.
-
The value at index, counting from the first, which is 0. Panics unless index is from 0 to Count minus 1.
-
Gives the value at index, counting from the first, a new value. Panics unless index is from 0 to Count minus 1.
-
Whether it holds
value. -
The values from first to last, in a new array.
-
Takes every value out.
-
A new, empty Deque.
-
A new Deque with the same values.
-
The values from first to last. Adding or removing a value while going over them panics.
Report an issue with this page or with FutureBlitz on GitHub.