Results 1 to 3 of 3
Thread: Is this a Selection Sort?
- 10-22-2010, 04:17 AM #1
Is this a Selection Sort?
Just wanting to verify that this is a Selection Sort
Java Code:public void selectionSort() { int out, in, min; for(out=0; out < reg4ArrList.size()-1; out++) { for(in=out+1; in < reg4ArrList.size(); in++) { min = out; if(reg4ArrList.get(in).getCountryName().compareToIgnoreCase (reg4ArrList.get(min).getCountryName()) < 0) { min = in; swap(min, out); }//end if }//end inner for }//end outer for }//end selectionSort() private void swap(int i, int j) { Country temp1 = reg4ArrList.get(i); reg4ArrList.set(i, reg4ArrList.get(j)); reg4ArrList.set(j, temp1); }//end swap()
- 10-22-2010, 04:54 AM #2
Looks like one to me :)
Sincerely, Joshua Green
Please REP if I help :)
- 10-22-2010, 05:00 AM #3
Similar Threads
-
Problem with selection sort
By Metastar in forum New To JavaReplies: 6Last Post: 10-21-2010, 02:18 AM -
Selection Sort recursive java code
By myst in forum New To JavaReplies: 3Last Post: 07-12-2010, 10:08 AM -
selection sort
By mayhewj7 in forum New To JavaReplies: 1Last Post: 04-29-2009, 12:40 AM -
write a selection sort without having numerous variable?
By seandingobat in forum New To JavaReplies: 6Last Post: 10-28-2008, 02:33 PM -
Selection sort in Java
By Java Tip in forum AlgorithmsReplies: 0Last Post: 04-15-2008, 07:41 PM


LinkBack URL
About LinkBacks
Reply With Quote
Bookmarks