Toggle navigation
Home
Latest pastes
FAQ
Random
BitBin is shutting down!
Register
Login
Untitled
SUBMITTED BY:
Guest
DATE:
June 15, 2013, 4:36 p.m.
FORMAT:
Text only
SIZE:
504 Bytes
Raw
Download
Tweet
HITS:
31388
Go to comments
Report
String[] words = {"so", "in", "very", "every", "do"};
public static void sortArray(Comparable[] compTab) {
for (int next=1; next < compTab.length; next++) {
Comparable value = compTab[next];
int this;
for (this = next; this > 0 && value.compareTo(compTab[this-1]) < 0; this--) {
compTab[this] = compTab[this-1];
}
compTab[this] = value;
writeArray(next + " run through: ", compTab);
}
}
Please enable JavaScript to view the
comments powered by Disqus.
comments powered by
Disqus