[LintCode] Nuts & Bolts Problem

public void sortNutsAndBolts(String[] nuts, String[] bolts, NBComparator compare) { // write your code here sort(nuts,bolts,0,nuts.length-1, compare); } public void sort(String[] nuts, String[] bolts, int l, int h, NBComparator compare) { if(l < h){ int p = partition(nuts, l,h, bolts[h], compare); partition(bolts, l,h,nuts[p], compare); sort(nuts, bolts, l, p-1,compare); sort(nuts, bolts, p+1, h,compare); } } public int […]