private List<TempTable> doAMergeIteration(List<TempTable> runs) {
		List<TempTable> result = new ArrayList<TempTable>();
		int numofbuf = BufferNeeds.bestRoot(runs.size(),tx);
		TempTable ps[] = new TempTable[numofbuf];
		while (runs.size() > numofbuf) {
			for (int i = 0; i < numofbuf; i++)
				ps[i] = runs.remove(0);
			result.add(mergeServeralRuns(ps));
		}
		int lastruns = runs.size();
		if (lastruns > 1) {
			TempTable qq[] = new TempTable[lastruns];
			for (int i = 0; i < lastruns; i++)
				qq[i] = runs.remove(0);
			result.add(mergeServeralRuns(qq));
		} else if (lastruns == 1)
			result.add(runs.remove(0));
		return result;
	}
private List < TempTable > doAMergeIteration ( List < TempTable > runs ) { List < TempTable > result = new ArrayList < TempTable > ( ) ; int numofbuf = BufferNeeds . bestRoot ( runs . size ( ) , tx ) ; TempTable ps [ ] = new TempTable [ numofbuf ] ; while ( runs . size ( ) > numofbuf ) { for ( int i = 0 ; i < numofbuf ; i ++ ) ps [ i ] = runs . remove ( 0 ) ; result . add ( mergeServeralRuns ( ps ) ) ; } int lastruns = runs . size ( ) ; if ( lastruns > 1 ) { TempTable qq [ ] = new TempTable [ lastruns ] ; for ( int i = 0 ; i < lastruns ; i ++ ) qq [ i ] = runs . remove ( 0 ) ; result . add ( mergeServeralRuns ( qq ) ) ; } else if ( lastruns == 1 ) result . add ( runs . remove ( 0 ) ) ; return result ; }
}