Best algorithm to sort the given values
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??
The Google keyword you're looking for is "natural sort".