Best sorting method to use
What is the best sorting method (speed wise) to use to sort roughly 40,000+ objects in ascending/desceding order? Selection sort only comes to mine. Are there any others?
What I have to do is find any duplicate numbers in a 40,000+ list. My game plan to approach this problem is ...
1) Sort the numbers in ascending/descending order first
2) After a sorted list is created, take the first number and compare it to every other number in that list. If a match if found, record it.
3) Move on the next number in the list and repeat step 2. Do this until you reach the bottom of the list.
Are there any problems with my thinking or is there something I can do to make more algorihim more efficent?