Lexicographic Order

Lexicographic ordering is similar to an alphabetical ordering.  Formally, two n-tuples and are ordered lexicographically if there exists a nonnegative such that and .  When comparing two tuples of different length, you append the shorter tuple with zeroes (or the characters with lowest comparison value in your alphabet).

Example


Copyright 2000 Rensselaer Polytechnic Institute. All Rights Reserved.