|
The problem doesn't specify the relative order of anagram-equivalent words, such as art and tar. You may let them come out in whatever arbitrary order the sorting algorithm gives them. Or, if you want to be fancier, you can put them in alphabetical order. The elegant way to do this will be to code a single ordering function that uses the anagram-canonical form first, then uses alphabetical order on the original words to break ties. Mike O'D. |
to: