Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

Finding the permutation that sorts a list

Given a list (say, of numbers) L, the method L.sort() will put its elements in order. The function sorted(L) returns a new list with the elements of L in order. I would like a version of sorted that will not return the elements of L in sorted order, but rather, the permutation that puts them in sorted order. Does this exist in Sage? Thanks.