Loop continues until it reaches the end of one of the vectors
while ( i < v1 . size ( ) && j < v2 . size ( ) ) { if ( v1 . elementAt ( i ) <= v2 . elementAt ( j ) ) { v . add ( v1 . elementAt ( i ) ) ; i ++ ; } else { v . add ( v2 . elementAt ( j ) ) ; j ++ ; } }