Module slice

Module slice 

Source
Expand description

Extension methods for slices.

§Methods

permutations

Generates all possible permutations of a mutable slice, passing them one at a time to a callback function. Uses Heap’s algorithm for efficiency, modifying the slice in place.

half_permutations

Like permuations, but skip any permutation which is lexically reversed from an earlier callback. Only half the permutations are visited in total. Uses Steinhaus-Johnson-Trotter’s algorithm, modifying the slice in place.

Traits§

SliceOps