Struct std::vec::Permutations

pub struct Permutations<T> {
    priv swaps: ElementSwaps,
    priv v: ~[T],
}

An Iterator that uses ElementSwaps to iterate through all possible permutations of a vector.

The first iteration yields a clone of the vector as it is, then each successive element is the vector with one swap applied.

Generates even and odd permutations alternatingly.

Trait Implementations

impl<T: Clone> Iterator<~[T]> for Permutations<T>

fn next(&mut self) -> Option<~[T]>

Advance the iterator and return the next value. Return None when the end is reached.