Reputation: 21
I want to sort a vector contains like [a,b,1,3,5,z]
both ascending and descending on Java ME, i.e. without using function like Collections.sort()
Upvotes: 2
Views: 2858
Reputation: 67760
Exchange sort in 3 sentences:
Upvotes: 1
Reputation: 3078
Copy the implementation of Collections.sort(), paste and modify it so much that you will be able to claim that you have "only been inspired" by it.
It's not cheating, it's learning from the chosen implementation.
Upvotes: -1
Reputation: 9621
If it's a vector you can have a look at this example:
http://www.java-examples.com/sort-java-vector-descending-order-using-comparator-example
Upvotes: 0