private int partition(Vector templates, int p, int r) { final Template x = (Template)templates.elementAt(p); int i = p - 1; int j = r + 1; while (true) { while (x.compareTo((Template)templates.elementAt(--j)) > 0); while (x.compareTo((Template)templates.elementAt(++i)) < 0); if (i < j) { templates.set(j, templates.set(i, templates.elementAt(j))); } else { return j; } } }
private int partition(Vector templates, int p, int r) { final Template x = (Template)templates.elementAt(p); int i = p - 1; int j = r + 1; while (true) { while (x.compareTo((Template)templates.elementAt(--j)) > 0); while (x.compareTo((Template)templates.elementAt(++i)) < 0); if (i < j) { templates.set(j, templates.set(i, templates.elementAt(j))); } else { return j; } } }
private int partition(Vector templates, int p, int r) { final Template x = (Template)templates.elementAt(p); int i = p - 1; int j = r + 1; while (true) { while (x.compareTo((Template)templates.elementAt(--j)) > 0); while (x.compareTo((Template)templates.elementAt(++i)) < 0); if (i < j) { templates.set(j, templates.set(i, templates.elementAt(j))); } else { return j; } } }
private int partition(Vector templates, int p, int r) { final Template x = (Template)templates.elementAt(p); int i = p - 1; int j = r + 1; while (true) { while (x.compareTo((Template)templates.elementAt(--j)) > 0); while (x.compareTo((Template)templates.elementAt(++i)) < 0); if (i < j) { templates.set(j, templates.set(i, templates.elementAt(j))); } else { return j; } } }