Category Archives: Matrix

Find number of transformation to make two Matrix Equal

Given two matrices A and B of order n*m. The task is to find the required number of transformation steps so that both matrices became equal, print -1 if it is not possible. Transformation step is as: i) Select any one matrix out of two matrices. ii) Choose either row/column of selected matrix. iii) Increment… Read More »

Form coils in a matrix

Given a positive integer n that represents dimensions of a 4n x 4n matrix with values from 1 to n filled from left to right and top to bottom. Form two coils from matrix and print the coils. Examples: Input : n = 1; Output : Coil 1 : 10 6 2 3 4 8… Read More »

Printing brackets in Matrix Chain Multiplication Problem

Prerequisite : Dynamic Programming | Set 8 (Matrix Chain Multiplication) Given a sequence of matrices, find the most efficient way to multiply these matrices together. The problem is not actually to perform the multiplications, but merely to decide in which order to perform the multiplications. We have many options to multiply a chain of matrices… Read More »