What is exact meaning of lexicographically sorted order?

120 Views Asked by At

I have tried to understand that, for example if an array consist of 2 element say 2 and 11. the lexicographically order would be 11 , 2 (Since 1st element, It's all digit lie smaller than compare to 2nd element digit)

And in other case, where if we have a list containing two words, {educative, educated}. So to sort this list in lexicographical order. after comparing these two words letter by letter and sorting these letters alphabetically. As a result, our list will become {educated, educative}. (since we have 2 unmatched character, And 'e' comes before 'i', so word2 comes before word1).

So is this how lexicographically order work in both case?

0

There are 0 best solutions below