These are ordered data structures, so lexicographic comparisons can be done the same way as they are for vectors.