[sort5 $x]should return the same results as
[lsort -ascii -index 0 $x]However, you may not use any form of the [lsort] command in its implementation.You need not check that the input is well formed. You may assume that it is a five-element list, and that each element is itself a well-formed list. (In other words, if you feel like tailoring a special sorting routine that's specifically targeted to five-element lists, go right ahead!) Submissions will be judged first on correctness, including stability, and second on speed.
Tcl 2002 programming contest: solutions to problem 1
The Great Canadian Tcl/Tk Programming Contest, eh?