954,510 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

how to use sorting algorithm

guys, i am making a program in java. i have to use a sorting agoritm. i manage to get some from the internet
but it seems that they are too technical and hard to understand and i dont know where to put them and how to use them.
here is my codes!please help me on where i will put the sorting algo..
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
import javax.swing.*;
public class StudGrade {
public static void main(String args[]) {
String sGrade="";
int grade[] = new int [11];
for(int iGrade=1;iGrade<11;iGrade++)
{
sGrade=JOptionPane.showInputDialog("Student "+iGrade);
grade[iGrade]=Integer.parseInt(sGrade);
}
String output2="";
String output = "Students\tGrades\n";
float sum = 0;
float average=0;
for (int counter = 1;counter=0; ) {
boolean flipped = false;
for (int j = 0; j a[j+1]) {
int T = a[j];
a[j] = a[j+1];
a[j+1] = T;
flipped = true;
}
pause(i,j);
}
if (!flipped) {
return;
}
}
}
}
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
i am an IT diploma student in a small town in philippines. guys, any help from you will be fully appreciated.
///////////////////////////////////////////////:cheesy: ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

totengtoh
Newbie Poster
5 posts since Dec 2006
Reputation Points: 10
Solved Threads: 0
 

".i may be not become a good programmer,i want to be one."

Wrong attitude. Why should we help someone becoming a bad programmer? There are more than enough bad programmers already...

As to examples of programs using sorting algorithms, just look around you.
You find sorted lists of stuff everywhere.

jwenting
duckman
Team Colleague
8,392 posts since Nov 2004
Reputation Points: 1,662
Solved Threads: 337
 

sorry for the attitude! tnx anyway! longlive!

totengtoh
Newbie Poster
5 posts since Dec 2006
Reputation Points: 10
Solved Threads: 0
 

".i may be not become a good programmer,i want to be one."
what i mean is, i may not become good in programming, not a bad progrmmer. sorry coz what ive written is not clear

totengtoh
Newbie Poster
5 posts since Dec 2006
Reputation Points: 10
Solved Threads: 0
 

This article has been dead for over three months

Post: Markdown Syntax: Formatting Help
You