# Category Archives: Matrix

## Print matrix in antispiral formMarch 7, 2017

Given a 2D array, the task is to print matrix in anti spiral form: Examples: Output: 16 15 14 13 12 11 10 9 8… Read More »

## C Program To Check whether Matrix is Skew Symmetric or notMarch 6, 2017

A Skew Symmetric Matrix or Anti-Symmetric Matrix is a square matrix whose transpose is negative to that of the original matrix. If the entry in… Read More »

## Program to find Normal and Trace of a matrixMarch 4, 2017

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… Read More »

## Gold Mine Problem

Given a gold mine of n*m dimensions. Each field in this mine contains a positive integer which is the amount of gold in tons. Initially… Read More »

## Easy way to remember Strassen’s Matrix EquationMarch 3, 2017

Strassen’s matrix is a Divide and Conquer method that helps us to multiply two matrices(of size n X n). You can refer to the link,… Read More »

## Sort a Matrix in all way increasing order

Given a square matrix of order N*N having distinct elements, the task is to sort given matrix in such a way that its rows, columns… Read More »

## Minimum operations required to set all elements of binary matrixMarch 2, 2017

Given a binary matrix of N rows and M columns. The operation allowed on the matrix is to choose any index (x, y) and toggle… Read More »

## Finding the maximum square sub-matrix with all equal elements

Given a N x N matrix, determine the maximum K such that K x K is a submatrix with all equal elements i.e., all the… Read More »

## Maximize sum of N X N upper left sub-matrix from given 2N X 2N matrixFebruary 28, 2017

Given a 2N x 2N matrix of integers. You are allowed to reverse any row or column any number of times and in any order.… Read More »

## Print a matrix in alternate manner (left to right then right to left)February 26, 2017

Given a 2D array, the task is to print the 2D in alternate manner (First row from left to right, then from right to left,… Read More »

## Maximum path sum that starting with any cell of 0-th row and ending with any cell of (N-1)-th rowFebruary 25, 2017

Given a N X N matrix Mat[N][N] of positive integers. There are only three possible moves from a cell (i, j) (i+1, j) (i+1, j-1)… Read More »

## Find whether there is path between two cells in matrixFebruary 24, 2017

Given N X N matrix filled with 1 , 0 , 2 , 3 . Find whether there is a path possible from source to… Read More »

## Distance of nearest cell having 1 in a binary matrixFebruary 22, 2017

Given a binary matrix of N x M, containing at least a value 1. The task is to find the distance of nearest 1 in… Read More »

## Sum of matrix element where each elements is integer division of row and columnFebruary 20, 2017

Consider a N X N matrix where each element is row number divide by column number (integer division), i.e. mat[i][j] = floor((i+1)/(j+1)) where 0 4… Read More »

## Sparse Matrix and its representations | Set 2 (Using List of Lists and Dictionary of keys)

Prerequisite : Sparse Matrix and its representations Set 1 (Using Arrays and Linked Lists) In this post other two methods of sparse matrix representation are… Read More »