[ kokanidja2 @ 24.06.2008. 19:26 ] @
/** * A bubble sort demonstration algorithm * SortAlgorithm.java, Thu Oct 27 10:32:35 1994 * * @author James Gosling * @version 1.6f, 31 Jan 1995 */ class BubbleSortAlgorithm extends SortAlgorithm { void sort(int a[]) throws Exception { for (int i = a.length; --i>=0; ) for (int j = 0; j<i; j++) { if (stopRequested) { return; } if (a[j] > a[j+1]) { int T = a[j]; a[j] = a[j+1]; a[j+1] = T; } compex(j, j+1); pause(i); } } } E sad nije mi jasno sta radi compex(i,j)? zna li ko?...u dokumentaciji nisam uspio da nadjem(hm, smotan :) ) |