I tried searching this word but unable to get proper answer...
Is lexicographical
means sorting alphabetically OR if two or more parameters share the same name, they are sorted by their value.
Thanks for your help!!!!.....
I tried searching this word but unable to get proper answer...
Is lexicographical
means sorting alphabetically OR if two or more parameters share the same name, they are sorted by their value.
Thanks for your help!!!!.....
If you sort the numbers 2,3,4 and 23 numerically, you get 2,3,4,23
If you sort them lexicographically, you get 2,23,3,4
For example, the output of ls -l
is sorted lexicographically, therefore you see
file2
file23
file3
file4
Instead of
file2
file3
file4
file23
lexicographical order
stands for the way you order data (sort) - like in dictionary (alphabetically).
That is, in java, if you want to sort Strings you just order them using a.compareTo(b) < 0
. If you have String[N] strings
it will be lexicographically sorted if the following holds:
strings[0].compareTo(strings[1]) < 0
strings[1].compareTo(strings[2]) < 0
...
strings[n-2].compareTo(strings[n-1]) < 0
Read more on wikipedia