Skip to content

Category Archives: Matrix

Given a binary matrix Matrix[][] of size M * N. Then the task is to return YES or NO, by checking whether the structure follows… Read More
Given a matrix M[][] of size N * M containing characters 0 and X. You have to choose a sub-matrix of 2*2 size, which doesn’t… Read More
Given a Matrix size N*N and an integer K. Initially, the matrix contains only 0. You are given K tasks and for each task, you… Read More
Given a binary matrix grid[][] of size M*N where ‘0‘ represents a blocked cell and ‘1’ represents a normal cell and a source (sx, sy)… Read More
Given a matrix mat[][] of size N * N, where mat[i][j] represents the time taken to reach from ith city to jth city. Also, given… Read More
Given a matrix A[][] of size N * N, where each matrix element is either -1 or 1. One can move from (X, Y) to… Read More
What is the Determinant of a Matrix? The determinant of a Matrix is a special number that is defined only for square matrices (matrices that have… Read More
Given two N x M matrices. Find a N x M matrix as the sum of given matrices each value at the sum of values of… Read More
Given a 2D matrix, the task is to find Trace and Normal of matrix.Normal of a matrix is defined as square root of sum of… Read More
The below program checks if two square matrices of size 4*4 are identical or not. For any two matrices to be equal, the number of… Read More
Given two matrices, the task to multiply them. Matrices can either be square or rectangular. Examples:  Input : mat1[][] = {{1, 2}, {3, 4}} mat2[][]… Read More
Given a 2D square matrix, find the sum of elements in Principal and Secondary diagonals. For example, consider the following 4 X 4 input matrix. … Read More
Given a 2D array, sort each row of this array and print the result.Examples:  Input: 77 11 22 3 11 89 1 12 32 11… Read More
Given a matrix, clockwise rotate elements in it. Examples: Input: 1 2 3 4 5 6 7 8 9 Output: 4 1 2 7 5… Read More
Transpose of a matrix is obtained by changing rows to columns and columns to rows. In other words, transpose of A[][] is obtained by changing… Read More

Start Your Coding Journey Now!