I need to sort some codes, but in a strange manner
I need to sort in a non-normal order, I need to sort the 40s first, then 50s, 90s, 70s, 80s, 60s, 20s, 30s, 10s, 00s.
What’s the best way to go about this?
It’s in C#.net 3.5
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
You can usually provide a custom method to do the sorting (either to a sort method or a sorted collection class that holds these values.
Or are you asking what the algorithm inside that method should be?
For the algorithm, you can use the following methods:
I’m sure there is a more efficient way (especially for
getFirstOrder(), but this should put you in the right direction