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