If you want to change it so that the same vectors will be compared, lengthened, and shortened respectively, you can do that. It's just that you won't bump the loop count until the comparison between the two elements fails. The abs(v[i].back () - v[i + 1].front ()) < whatever comparison is still only a comparison.
The output might look like this:
Code:
vector[0] = ( 37, 20, 32, 70, 63, ).
vector[1] = ( 31, 95, 49, 93, 38, 24, 30, 12, ).
vector[2] = ( 90, 74, ).
vector[3] = ( 36, 83, 27, 79, 74, 70, 51, 60, 55, ).
vector[4] = ( 96, ).
Isn't that what you expect?