riffleIn method

Queue<E> riffleIn({
  1. bool inverse = false,
})

Splits into two and uses interleave to combine, second half first.

1, 2, 3, 4, 5, 6.riffleIn() returns 4, 1, 5, 2, 6, 3. 1, 2, 3, 4, 5, 6.riffleOut() returns 1, 4, 2, 5, 3, 6.

Odd number of elements: 1, 2, 3, 4, 5.riffleIn() returns 3, 1, 4, 2, 5. 1, 2, 3, 4, 5.riffleOut() returns 1, 4, 2, 5, 3.

inverse goes back to original: 3, 1, 4, 2, 5.riffleIn(inverse: true) returns 1, 2, 3, 4, 5.

Implementation

Queue<E> riffleIn({bool inverse = false}) {
  return h.riffleInIterable(original: this, inverse: inverse).toQueue();
}