Suppose I have the following values:-
xyz12@abc
xyz1@abc
xyz15@abc
xyz2@abc
xyz22@abc
I want the sorted output to be in form:-
xyz1@abc
xyz2@abc
xyz12@abc
xyz15@abc
xyz22@abc
If I use strcmp, then it will compare by each character and will give xyz1@ > xyz12 as @ > 2 which I don't want. What different algorithms can I use to sort this in the required format??
sorting algorithmandcomparation criterium[email protected]and[email protected], the results should list both those before thexyz*names, but[email protected]should be listed before[email protected]because 91 comes before 190 numerically. It is as yet undefined whetherXYZ7@ABCshould come before, after or in the midst of the original entries.