<, > and ==, to find the element.<, > and == to find the needle.O(n) and is thus not efficient for insertions that are not near the start or end of the deque.
[1, 2].join ", " // "1, 2"
[1, 2].join ", ": "0x$(%02x it)" // "0x01, 0x02"
list[from..to]. Since both arguments are optional (as they have default values), it is valid to omit from or to.
list := [1, 2, 3, 4, 5]
sub := list[1..3] // A view into [2, 3]
sub[0] = 22
print list // => [1, 22, 3, 4, 5]
sub = list[..3] // A view into [1, 22, 3]
sub.sort --in-place // Sorts just the 3 values.
print sub // => [1, 3, 22]
print list // => [1, 3, 22, 4, 5]
sub2 := sub[1..]
print sub2 // => [3, 22]
sub2[1] = 499
print list // => [1, 3, 499, 4, 5]
sub3 := list[2..].copy // => Creates a copy of [499, 4, 5]
sub3[0] = 3 // This time only the copy is affected.
print sub3 // => [3, 4, 5]
print list // => [1, 3, 499, 4, 5]
O(n) and is thus not efficient for deletions that are not near the start or end of the deque.O(n) and thus not efficient.O(n) and thus not efficient.O(n) and thus not efficient.a and b and should return:a < b,a == b, anda > b.