I'm trying to understand the concept of lexicographically larger or smaller strings. My book gives some examples of strings that are lexicographically larger or smaller than each other and an intermediary string that is between the two in size.
string 1: a
string 2: b
intermediary string: c
string 1: aaa
string 2: zzz
intermediary string: yyy
string 1: abcdefg
string 2: abcdefh
intermediary string: (none)
I'm not sure what the requirement is for a string to be lexicographically in between the two strings. Is it that every letter of the intermediary string has to be greater than the first string and less than the second?
For example, "bcdefg" is the intermediary string between "abcdef" and "cdefgh". And "stuvx" cannot be the intermediary between "stuvw" and "stuvy".
Aucun commentaire:
Enregistrer un commentaire