if (mat1[i][1] < mat2[j][1]) /* col of mat1 < mat2 */
{
mat3[k][0] = mat1[i][0];
mat3[k][1] = mat1[i][1];
mat3[k][2] = mat1[i][2];
k++; i++;
}
else
if (mat1[i][1] > mat2[j][1]) /* col of mat1 > mat2 */
{
mat3[k][0] = mat2[j][0];
mat3[k][1] = mat2[j][1];
mat3[k][2] = mat2[j][2];
k++; j++;
}
else
{ /* col of mat1 = mat2 */
mat3[k][0] = mat2[i][0];
mat3[k][1] = mat2[i][1];
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month, and much more.