return a permutation that sorts a list of strings - Maple Help

Online Help

All Products    Maple    MapleSim


Home : Support : Online Help : Programming : Names and Strings : StringTools Package : Transformations : StringTools/SortPermutation

StringTools[SortPermutation] - return a permutation that sorts a list of strings

Calling Sequence

SortPermutation( los )

Parameters

los

-

list(string); a list of strings

Description

• 

The SortPermutation( los ) command returns a permutation p that sorts the list los, that is, for which seqlospi,i=1..nopslos is equal to sortlos. The sorting order is lexicographic.

• 

The permutation returned by SortPermutation is represented as a list of the positive integers from 1 to nopslos.

• 

Note that an empty list, which is vacuously a permutation, is returned if the input list los is empty.

Examples

withStringTools:

L:=b,c,a:

p:=SortPermutationL

p:=3,1,2

(1)

typep,'permlist'

true

(2)

seqLpi,i=1..3

a,b,c

(3)

sortL

a,b,c

(4)

SortPermutation

(5)

See Also

sort, string, StringTools


Download Help Document

Was this information helpful?



Please add your Comment (Optional)
E-mail Address (Optional)
What is ? This question helps us to combat spam