G
Guest
Hi everybody.
Can somebody direct me to a correct algorithm to solve the sort problem of
the following array of data:
ServerWeb.*
ServerWebSomething1
ServerWebSomething2
ServerWeb3
ApplicationServer1
App.*
ApplicationServer2
should be sorted as this:
ApplicationServer1
ApplicationServer2
App.*
ServerWebSomething1
ServerWebSomething2
ServerWeb3
ServerWeb.*
The point is that the data is first sorted alphabetically, and then withing
the similar types of data I need to get the data with more specific to the
top and those less specific to the bottom.
For instance, as ServerWeb.* covers all servers that starts with the
"ServerWeb" it is the least distinctive, while ServerWebSomething1 is the
most distinctive in that subgroup.
This just puzzles me, I would appreciate any algorithm in any language if C#
example is not available.
Thanks.
Can somebody direct me to a correct algorithm to solve the sort problem of
the following array of data:
ServerWeb.*
ServerWebSomething1
ServerWebSomething2
ServerWeb3
ApplicationServer1
App.*
ApplicationServer2
should be sorted as this:
ApplicationServer1
ApplicationServer2
App.*
ServerWebSomething1
ServerWebSomething2
ServerWeb3
ServerWeb.*
The point is that the data is first sorted alphabetically, and then withing
the similar types of data I need to get the data with more specific to the
top and those less specific to the bottom.
For instance, as ServerWeb.* covers all servers that starts with the
"ServerWeb" it is the least distinctive, while ServerWebSomething1 is the
most distinctive in that subgroup.
This just puzzles me, I would appreciate any algorithm in any language if C#
example is not available.
Thanks.