Wed, 20 Aug 2008 08:03:00 GMT

Sorting an array by another array

Suppose you want to sort an array of strings according to some prescribed order. In other words, you are given an array of strings as input, plus another array of strings describing the required ordering. The result is another array of strings equal to the first but sorted by the second.