Sort Array Using Prefix Reversals
Sort a permutation by reversing prefixes whose lengths are allowed, finding the fewest reversals with a breadth-first search over arrangements.
Sort a permutation by reversing prefixes whose lengths are allowed, finding the fewest reversals with a breadth-first search over arrangements.