Generating all lexicographical permutations without comparisons of elements <p>I came into the problem when I have a given sequence s=(a,b,c,d,e...) - sorted in non-decreasing order. My job is to develop an algorithm that is going to generate all possible permutations in lexicographical order - ending on the reversed s (highest in order).</p> <p>The trick is: I cannot compare any 2 element to each other. All operations must be done "automatically", regardless of elements values.</p>