lexicographical
Lexicographical is an adjective relating to lexicon and to lexicography, the practice of compiling dictionaries. In mathematics and computer science it refers to a method of ordering sequences, such as strings or tuples, by dictionary order. A sequence a is less than b lexicographically if at the first position where they differ, a's element is smaller than b's; if all corresponding elements are equal but one sequence ends earlier, the shorter sequence is considered smaller. For example, the string apple is less than banana because 'a' < 'b', and the numeric sequences (1, 2) < (1, 3) because 2 < 3. When applied to strings, the order follows the underlying character order (such as Unicode code points) and may be influenced by case sensitivity or locale-specific collation.
There are variations such as case-insensitive lexicographic orders or locale-aware collation rules. Some contexts also use
Common uses include sorting words or records in dictionaries, ordering keys in data structures, and generating
The term derives from Greek lexikos, meaning of words, from lexis, word, and the suffix -ic relating