for i ( 0 .. n ) { f( a[i] ); // the required stuff for a[] f'( b[i] ); // the required stuff for b[] g( a[i], b[i] ); // and whilst we have them, do something to, or accumulate some statistic, that might help the subsequent merge. } #### f( a[0] ); f'( b[0] ); for i ( 1 .. n ) { f( a[i] ); f'( a[i] ); g( a[i], a[i-1] ); g'( b[i], b[i-1] ); }