Hi,
Im new to java
im trying to study sorting methods specifically bubble sorting
i found this code online but couldn't understand what it means. can someone kindly comment the codes so I can uderstand it well.
TIA
here's the code
public static void sort( int a[], int n ) // Bubble Sorting //
{
int i, j,t=0;
for(i = 0; i < n; i++)
{
for(j = 1; j < (n-i); j++)
{
if(a[j-1] > a[j])
{
t = a[j-1];
a[j-1]=a[j];
a[j]=t;
}
}
}
}